Main Menu

Moteino Receiver

Started by Zeldatwili, October 31, 2014, 05:57:54 PM

Zeldatwili

i think i almost got it, its just now the motionmote sketch is giving me trouble. when i try to compile it it gives me this error:
Arduino: 1.0.6 (Windows 7), Board: "Moteino"
LowPower\LowPower.cpp.o: In function `LowPowerClass::idle(period_t, adc_t, timer2_t, timer1_t, timer0_t, spi_t, usart0_t, twi_t)':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:153: multiple definition of `LowPowerClass::idle(period_t, adc_t, timer2_t, timer1_t, timer0_t, spi_t, usart0_t, twi_t)'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:153: first defined here
LowPower\LowPower.cpp.o: In function `LowPowerClass::adcNoiseReduction(period_t, adc_t, timer2_t)':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:515: multiple definition of `LowPowerClass::adcNoiseReduction(period_t, adc_t, timer2_t)'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:515: first defined here
LowPower\LowPower.cpp.o: In function `LowPowerClass::powerDown(period_t, adc_t, bod_t)':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:586: multiple definition of `LowPowerClass::powerDown(period_t, adc_t, bod_t)'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:586: first defined here
LowPower\LowPower.cpp.o: In function `LowPowerClass::powerSave(period_t, adc_t, bod_t, timer2_t)':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:653: multiple definition of `LowPowerClass::powerSave(period_t, adc_t, bod_t, timer2_t)'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:653: first defined here
LowPower\LowPower.cpp.o: In function `LowPowerClass::powerStandby(period_t, adc_t, bod_t)':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:737: multiple definition of `LowPowerClass::powerStandby(period_t, adc_t, bod_t)'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:737: first defined here
LowPower\LowPower.cpp.o: In function `LowPowerClass::powerExtStandby(period_t, adc_t, bod_t, timer2_t)':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:797: multiple definition of `LowPowerClass::powerExtStandby(period_t, adc_t, bod_t, timer2_t)'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:797: first defined here
LowPower\LowPower.cpp.o: In function `__vector_6':
C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:855: multiple definition of `__vector_6'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:855: first defined here
LowPower\LowPower.cpp.o:C:\Users\Sam\Documents\Arduino\libraries\LowPower/LowPower.cpp:153: multiple definition of `LowPower'
LowPower.cpp.o:C:\Users\Sam\AppData\Local\Temp\build3126858160797770351.tmp/LowPower.cpp:153: first defined here


i know, its a lot, but i have no idea what it means. do you have any idea?

Felix

Looks like you have conflicting LowPower libraries. Make sure they are installed correctly and ONLY 1 instance is present in your Arduino/libraries folder.

Zeldatwili

Hmmm.... When I have the gateway hooked up to the Pi and I listen to the serial port it will say stuff like that it's listening and it can't find the flash chip. But when I hook up the MotionMote to the Pi and listen to it, nothing is ever there.

Felix

Can you try to take it one by one and solve each issue at a time?
What exactly is not working?
Can you use a PC and Arduino IDE instead of a Pi? Consider the Pi the end application, in the meantime try to get started with the Moteinos on a PC to get a feel how they work.

Zeldatwili

I'm using the arduino ide on my Pc too, I just happen to be using it on my Pi that time. My problem is I cannot seem to get my motionmote and my gateway to talk to each other. I've checked the settings, which are correct.

Felix

Did you try to load the Gateway sketch on your gateway and Node sketch on the MotionMote?
Did you double check all the settings in the sketches to make sure they match the hardware settings? Did you do this on your Pc?

Zeldatwili

Yes yes and yes. I'm already using the gateway for one moteino, and switching out the node sketch instead of the motionmote sketch makes no difference. While I double check the settings I'm going to try and change the settings from 868 to 915 mhz and see if that makes a difference.

Felix

They have to be the same frequency.

Zeldatwili

#23
*sigh* I figured it out. While I was checking the settings I found out that the encryption key had to be 16 characters long, and I only had 10. I can't believe I never noticed this before, and therefore I'm very story for wasting your time on all of this. Then only thing now is to program it, and i know you told me before to look at your sump pump alert example, but thats really confusing with all that graphing code in there. All i want it to do it when theres a new message send a text that contains that message. what i'm not sure about is how i would get it to run the program when it receives a new message. i used this script https://github.com/iinnovations/iicontrollibs/blob/master/mote/piserialtest.py and it only worked once. when i tried it again nothing would show up, and besides, the script checking the port so often that it is using up all the cpu on my pi and i only really need to check the port maybe every minute or so. i tried the other scripts that are in the same folder as that one but they don't work either.

Felix

Well glad you figured that out.
As for the SMS stuff .. that is about 2 years old now and it's basically an example script. There are potentially many ways of sending an SMS. That script used a gmail API to send an email to your carrier phone address which is basically your SMS address, that's all ...

Zeldatwili

OK this is my last question related to this (I hope) and if you can't answer it its fine I can work around it. I wrote a script for sending SMS when there's mail and displaying information on the oled screen when theres mail, my only concern is sometimes when I run the script, it doesn't pick up new lines on the serial port. After restarting the script one or two times it eventually works, and I could just leave the script running indefinitely, but I still would like to know why that happens.

Felix

You mean your script doesn't pick up the output from serial?
I think it could be the way you're reading the input from serial. Watch out for new lines (if you send any new line characters from the moteino). Then in python you can read 1 line at a time or just keep reading until certain criteria is met. I usually just read 1 line at 1 time. That means every piece of output (every phrase) from moteino has to end with newline, so that the script knows when to stop reading. Again, I've done that in my example, you can probably follow that. Otherwise I can't think of anything else. As long as you restart the script it should release/relock the serial port and just work.