How can I see what files/libraries are loaded on the moteino? What do I need to do to get the oled to work?
Once the sketch is uploaded into the Moteino, there is no way to get the source code back. You can, however, dump the HEX code loaded and try to figure out a way of reading it back into something usefull.
Read this:
http://forum.arduino.cc/index.php?topic=6150.0 (http://forum.arduino.cc/index.php?topic=6150.0)
What is the brand/model of oled you have?
Ok. Thanks. The oled is the one from felix's store. https://lowpowerlab.com/shop/oled
I was able to get the moteino attached to my sonarmote programmed and reading distances (showing up in "serial monitor" in Arduino. Not too bad I guess for a really green newbie. Still waiting on my Pi. Still working on getting the node on the sonarmote and the gateway moteino to communicate. I appreciate all the help everyone has given
If you have the latest Arduino.cc IDE, go to the libraries Management menu and install the U8glib library. If you are using the "other" Arduino.org IDE, Google the library and install it.
Get the Lowpower librarie from here: https://github.com/lowpowerlab/lowpower (https://github.com/lowpowerlab/lowpower)
Then restart the Arduino IDE and open the motion oled mote sensor sketch from here:
https://github.com/LowPowerLab/RFM69/blob/master/Examples/OLEDMote/OLEDMote.ino (https://github.com/LowPowerLab/RFM69/blob/master/Examples/OLEDMote/OLEDMote.ino).
Change the sketch setup to reflect your network, encryption, radio type, baud rate, etc.
Connect the SDA pin of the oled to A4 of your Moteino and the SCL pin from the oled to the A5 pin of the moteino. Connect the GND pin to the GND and Vcc to 3.3v pin of the Moteino.
If you want to connect the LED and buttons just look into the example where they connect to. But to see your oled working, just upload the sketch like that and something should come up. Then go from there with sensor, leds, buttons and buzzer.
Good luck
Awesome. Thanks
Is it working?
i've gotten it to light up. just black and white static though. the board was a sonarmote board with presetup slot for the OLED that I got from Felix
That happened to me when I set the data pins in the wrong orientation. Try to connect the oled directly to the Moteino without any shield.
Ok. I may just fly without it. It's on the bottom side of the sonarmote board. I'd have to cut a hole in the case and get a 4 pin ribbon cable to move it. A second newbie question...should I be uploading multiple sketches to the moteino or should I compile them into one and upload one
Looks like the pins are reversed on the library. I'm out of my depth here.
Regarding your question, there can be only one sketch in any Moteino at any time. So you compile and upload it and if you want to change it you have to do it all over again
That's what I had decided. Makes sense why I could only get one thing at a time to work. That helps a lot ;D
ok, so how do I compile the sketches? I admit to being VERY new to this. Had a friend over last night who is very familiar with programming/linux/etc and he wasn't sure how to do it. I have ArduinoIDE and have uploaded one sketch at a time and I works great. I can't load the Node.ino and sonarmote.ino to the sonarmote. Do i have to load the sonarmote.ino to the miniusb on the sonarmote and load the node.ino via a ftdi adapter to the node moteino? I really appreciate everyone's help.
Kilo95,
There's a basic programming guide here (https://lowpowerlab.com/programming/).
For the SonarMote, the FTDI chip is already onboard so you program it after it's fully assembled and Moteino plugged into it, via the mini USB connector (which also charges the LiPo battery which should be attached).
I've tried to follow that guide but I can only get either the node sketch or the sonarmote sketch loaded separately to the sonarmote. It won't measure distance and transmit without both, is that correct? Someone on here said I should combine the two but I haven't seen anywhere that says how to do that
What are you trying to do with the SonarMote?
I have two moteinos. One for the sonarmote and one to connect to my Pi. I want to set it up on my sump pump and have it email me if the water level gets too high
Ok, this is the sketch (https://github.com/LowPowerLab/RFM69/blob/master/Examples/SonarMote/SonarMote_DistanceTracker/SonarMote_DistanceTracker.ino) you need for that.
Make sure to verify the sketch settings to match your Moteino.
See the SonarMote page (https://lowpowerlab.com/sonarmote/) for more examples.
Awesome! I really appreciate it. I was able to configure the freq and encryption details so that should wrk great. Thanks
I haven't seen the Sonarmote sketch yet, but I'm pretty sure that the Sonsrmote sketch is all you need to upload into the Sonarmote. Conceptually, you think of it as a node in your Moteino network. What you need now is to program another Moteino as a Gateway in order to receive the traffic from your Sonarmote. The Gateway sketch will allow a Moteino to interpret some incoming traffic received by its radio and either activate a digital output or send some message to an oled display connected to it.
So, first load the Sonarmote sketch on a Sonarmote node, then load a Gateway on another Moteino.
Make sure the network is is the same on both as well as the encryption key that must be the same on both.
Check the Sonarmote sketch and look for the gateway ID number and make sure that it points to the correct gateway ID number.
I'll look into the Sonarmote sketch later and see what needs to be done.
Don't give up, never surrender ;-)
The sonarmote sketch Felix gave me the link to just above in this post worked. The other one I had gotten off of GitHub wouldn't work. All is up and well now. Just have to set up the Pi. Btw, I don't give up easily
Never mind my post. For some reason I only read the last message of the 1st page, so I didn't see that your problem was already resolved.
How about some pics of your project to inspire us to turn that soldering iron on?
I'll try to post when I'm done. I didn't have to do much as Felix had a few that were complete. I got the sonarmote and gateway moteino to work properly. Almost done now. I do have a question though. I downloaded the Pi gateway image (the complete one). Do I still need to download the other files from github? For port forwarding, i use ports 80 and 444, is that correct? Thanks
Quote from: Kilo95 on September 10, 2015, 08:43:02 PM
I'll try to post when I'm done. I didn't have to do much as Felix had a few that were complete. I got the sonarmote and gateway moteino to work properly. Almost done now. I do have a question though. I downloaded the Pi gateway image (the complete one). Do I still need to download the other files from github? For port forwarding, i use ports 80 and 444, is that correct? Thanks
Everything is on the image ready to go. However sometimes i update the files at Github for bugs so it's good to check if there's a newer version there.
Ports are 80 and 443.
Ok. Thanks
ok, I downloaded the pigateway image and installed it to my sd. I setup and connected the wifi and forwarded ports 80 and 443 on my router. My question...how do i setup the .htpasswd file? I did the following from the manual install guide:
sudo echo -e "USERNAME:`perl -le 'print crypt("PASSWORD","SALT")'`"
sudo nano /var/www/default/.htpasswd
I just get "Pi:lettersandnumbers"
I also tried in the sudo echo line putting my own username and password, but still cant connected over my home wifi with those credentials. suspecting I don't have the user/pwd formatted correctly in the .htpasswd file. how do i fix it?
Also, I saw felix's comment about setting up the gateway moteino on the serial port. I just have usb. how do I set that up in the settings.js file? btw, i did do the upgrade, etc for raspbian before I started
ok. so i realized after running the first command that the output was an encrypted password and put that it. putting the Ip into a browser, it doesn't ask for the password but pulls up the gateway page and says "waiting for socket connection"...still need to know about how to tell the pi which port is the moteino (if i need to tell it)
I installed from the pigateway rasbian image, updated, etc. set email, username, password. I can't get the chat.js to work and when I try to "node gateway.js &" I get an error. I'll post a screen shot in a few minutes. I saw one post about a similar problem and I tried changing the socket.io path that was suggested. Still get this. When I connected via web browswer, I get the gateway page but it says "waiting for socket connection". I also went back through and did the install manually. Same result. Need help (imagine that ;))
If you install the image it should work. You can skip the chat.js, thats only for reference.
Otherwise follow the guide step by step and you should get the same results.
There are no guarantees though, I've done my best to provide both an image and a guide :)
ok. I got it to connect via web browser to the gateway page. It still says "Nodes Count: 0". I assume its not recognizing my usb moteino. can you tell me how to set it so it will recognize it on usb? I didnt see any instructions on the setup guide for that. pardon me if i missed it
What is the serial port of your MoteinoUSB?
Something like /dev/ttyUSB0 ?
Can you open minicom -b 115200 -D /dev/ttyUSB0 and make sure you're receiving data from remote Moteinos?
Did you setup that serial port (and everything else) in settings.js?
I think I may have missed setting the serial port up in settings .js. I did set up the other stuff. Will ifconfig show me which port its on?
Can you just follow my steps please?
ok, i set the serialport for usb and ran minicom. It receives the distance and battery voltage from the sonarmote. it still shows "nodes count: 0" in the web browser. also, I noticed that it only sends one measurement. I waited 5 minutes or so and never saw another measurement. if I log out of minicom and back in, it'll send a new single measurement from the sonarmote.
disregard about it not updating measurements. i moved it and it correctly updated. i do still need to get the web interface to show the node
You cant have a serial port in 2 places, only 1 can have it active. While in minicom the other place will freeze.
so whats the fix for the web interface? i logged out of everything else and it still doesn't show the node. the serial port is setup in settings.js along with the other settings. i have the gateway.ino on my gateway moteino (connected to the RPi). I tried to load the pigateway.ino but it flagged multiple errors.
You need this sketch (https://github.com/LowPowerLab/RFM69/tree/master/Examples/PiGateway) on your gateway, not gateway.ino.
I tried uploading it to the Moteino but I got multiple errors related to wirelesshex69. I commented out the "include wirelesshex69" at the top and get these errors. (I don't plan on wireless programming right now). Suggestions?
PiGateway.ino: In function 'void loop()':
PiGateway:69: error: 'readSerialLine' was not declared in this scope
PiGateway:111: error: 'CheckForWirelessHEX' was not declared in this scope
'readSerialLine' was not declared in this scope
Did you install the WirelessHex69 library? You can find it here: https://github.com/LowPowerLab/WirelessProgramming (https://github.com/LowPowerLab/WirelessProgramming)
yes. i reinstalled it for kicks. now I'm getting this error when I verify it in Arduino IDE
PiGateway.ino:13:78: fatal error: RFM69.h: No such file or directory
compilation terminated.
Error compiling.
I reinstalled the RFM69 library into the /Arduino/library/RFM69 folder but get the same result. I feel like i'm pretty close finally. lol
Every time you install a library, you have to restart the Arduino IDE for the new library to be used.
I did restart arduino ide after the reinstall
What is your Arduino IDE version? 1.6.5?
I'll have to look when I get home. I downloaded it within the last 4-5 weeks
Make a backup of your libraries, erase all libraries in Documents/Arduino/libraries and paste all libraries in the Program_Files/Arduino/libraries folder.
Did that just now and set preferences in Arduino to reflect correct library. Now
It can't find wirelesshex69. Maybe I'll play with it more tomorow
Here you go:
https://github.com/LowPowerLab/WirelessProgramming/archive/master.zip (https://github.com/LowPowerLab/WirelessProgramming/archive/master.zip)
Thanks. I have the wireless hex library installed. It just can't find it for some reason
Instalo the library directly from the IDE using the ZIP file. Then restart the IDE
ok. finally got the gateway GUI to work. everything is reading fine through there. my router is set to forward ports 80 and 443 on the static ip for my RPi but i can't get it to pull up from outside my home network using my public ip address. still working on that. thanks for all the help
Can you ping your Rpi static IP?
Open a cmd window on your Windows and enter ping 192.168.0.100, replacing the ip numbers with the correct ones, of course.
Do you get any reply?
yep. worked fine. tx/rx all 4 packets without problem. double checked my router config and i DO have it forwarding 80 and 443 internal to 80 and 443 external on my RPi's static ip. double checked my public ip and entered that. still not working. what am i missing?
Ok. So my isp was blocking most ports. I asked nicely and they opened the ports I wanted. I have to adjust the placement a little. It's measuring to the top of the pump which is 20cm down. Still have to get the messaging alert working. In which file is the distance set at which it sends an alert? I may need to drop the distance down to 12-15cm
Ok everything is working except text/email alerts. I can log in from remote network and see the gateway GUI working. (My isp was blocking ports. They are open now). I double checked my email, password, and cell address in settings.js. Is there anything I need to configure with Google? Any suggestions how to get the text alerts to work? (Gmail is my email)
If it's easier to use an aol email address I can make
A new one. I tried to look and see how to change that but wasn't successful. Could someone vel me out with that?
Sorry, but you'll have to wait for someone to get you going on that project. I never used a Raspbarry Pi so I have no idea why you are stuck now.
Kilo95,
You can use your gmail account. I would not put my straight password in there, instead i would generate a specific app password, here's a guide (http://www.shoutmeloud.com/how-to-generate-google-app-specific-password-2-step-verification.html)
Then you send email using your own gmail account to anywhere you want. To get SMS you send an email to your phone's associated SMS address (it's an email at your carrier, usually your
[email protected]).
Ok. I tried it with the straight password and used my @vtext.com address and it didn't work. I'll try making an app specific password. Which file do I adjust the distance in which it'll alert?
google your carrier for the email address. I don't have instructions for every carrier in the world, i just know what works for at&t and verizon.
What distance are you measuring for?
How about using Twitter? I created a Twitter account for my home automation system, which I follow, and when required, my house sends me all kinds of notifications with a simple Tweet.
I have my Verizon email. I believe the default to alert on the sump pump is 20cm. My water level runs from 14-21cm. I just need to know where to alter it so I'm not alerted when I don't need to be
Quote from: luisr320 on September 28, 2015, 09:24:13 AM
How about using Twitter? I created a Twitter account for my home automation system, which I follow, and when required, my house sends me all kinds of notifications with a simple Tweet.
Do you use the TwitterAPI? If so, which version?
In my experience there ain't no such thing as a
simple Tweet with that API! Once you have all the code, it's sort of, kind of easy, but lots of code behind each tweet.
Tom
I'm not on Twitter.
Quote from: Kilo95 on September 28, 2015, 09:52:52 AM
I have my Verizon email. I believe the default to alert on the sump pump is 20cm. My water level runs from 14-21cm. I just need to know where to alter it so I'm not alerted when I don't need to be
It's on this line in metrics.js (https://github.com/LowPowerLab/RaspberryPi-Gateway/blob/master/metrics.js#L161):
sumpSMS : { label:'SumpPump : SMS (below 20cm)', icon:'comment', descr:'Send SMS if water < 20cm below surface', serverExecute:function(node) { if (node.metrics['CM'] && node.metrics['CM'].value < 20 && (Date.now() - new Date(node.metrics['CM'].updated).getTime() < 2000)) { sendSMS('SUMP PUMP ALERT', 'Water is only 20cm below surface and rising - [' + node._id + '] ' + node.label + ' @ ' + (new Date().toLocaleTimeString() + (new Date().getHours() > 12 ? 'PM':'AM'))); }; } },I do hope you can do this change yourself.
Yep. Thanks. I set the app specific password up.
It's not really complicated to setup a way to sent Tweets via the Moteino, directly, if it is connected to a Ethernet shield, or from a command line. I send them trough a VB script in a Windows machine. If there is any interest on this I can show you guys how it's done. But since the intention is to use a RPI, it must be done with Linux. Can Linux handle a VB Script or is it only for a Windows machine? I think I can setup a simple Tweet gateway connecting a Moteino to an ENC28J60.
It doesn't matter that you do have a tweeter account. You simply create one for yourself and another for your system. Them you install the official Tweeter APP on your phone, and set it up so that you follow all the tweets your system posts.
I'm trying to narrow down the easiest way to do it and will post here soon.
Ok, your setup is different than mine. I use TwitterAPI and the underlying code uses curl from PHP. Works on any webhost that supports PHP, but you need a developer account. But this is getting off topic so sorry for the distraction.
Tom
There is a Python library, tweepy, that will allow anyone to send a simple Tweet with a command like tweet.py "message".
I have never used a RPI, so I have no idea if this is possible, but can you have an event run a command like that? That would send a Tweet to you. By event I mean, a Digital Input on the Moteino sending its status to the RPI status and the RPI would run that command line.
If this is possible, I can post how to make it run.
Does the email alert require a different port to be open? I've checked all my settings and still nothing comes through. I know they had 22, 80, and 443 blocked so I was starting to wonder if that's why the email isn't coming through
I changed the line in metrics.js to <50cm (water level is 20-21cm) to see if it'll trigger it. Checked in gateway.sys.log like someone suggested and it's not trying to send a SMS or email. I made sure the security in Gmail is set for low level apps. What am I doing wrong? Everything is showing up fine on the Moteino Gateway GUI online
I got it. It'll send SMS but not email but that's ok. I did a fresh install with the v6 image. thanks for all of the help and being patient with a newbie
Great, but that's strange.
When you say email doesn't work, can you give more details?
The SMS mechanism uses email as a means to send the SMS. You're basically relaying that SMS via email. So it does send email, otherwise you could not get the SMS on your phone.
I set up an email address and my mobile number email address to receive email and text alert. The text alert comes through but not the other email