Main Menu

Programming moteino

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

Kilo95

How can I see what files/libraries are loaded on the moteino? What do I need to do to get the oled to work?

luisr320

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

What is the brand/model of oled you have?

Kilo95

Ok.  Thanks. The oled is the one from felix's store. https://lowpowerlab.com/shop/oled

Kilo95

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

luisr320

#4
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
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.
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



Kilo95


luisr320


Kilo95

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

luisr320

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.

Kilo95

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

luisr320

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

Kilo95

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

Kilo95

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.

Felix

Kilo95,
There's a basic programming guide here.
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).

Kilo95

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