Main Menu

Programming moteino

Started by Kilo95, August 29, 2015, 04:42:52 PM

Felix

What are you trying to do with the SonarMote?

Kilo95

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

Felix

#17
Ok, this is the sketch you need for that.
Make sure to verify the sketch settings to match your Moteino.
See the SonarMote page for more examples.

Kilo95

Awesome! I really appreciate it. I was able to configure the freq and encryption details so that should wrk great. Thanks

luisr320

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 ;-)

Kilo95

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

luisr320

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?

Kilo95

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

Felix

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.

Kilo95


Kilo95

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

Kilo95

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)

Kilo95

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 ;))

Felix

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 :)

Kilo95

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