Beginner looking for advice

Started by Blue2swing, February 06, 2018, 08:55:08 AM

Blue2swing

Hello Everyone. Im new to the Moteino world and have some questions, but am mainly looking for some direction with getting started. I ordered 2 Moteinos about a Month ago and am just getting around to playing with them. I'v attempted to upload a sketch, written by a different user, to each Moteino but am having no success (Maybe some success.... I'm not sure  ;))

Here's the links for the project I'm following,
Github: https://github.com/blebson/Automated-Blinds
DIY Project Page: https://community.smartthings.com/t/battery-powered-solar-recharged-automated-blinds/99717/1

Here's details on the equipment I have and where I am at so far...
1 - Moteino R6 with a wire antenna accompanied by a RFM69W and on board flash memory
1 - Moteino R6 with a trace antenna, also accompanied with a RFM69W and flash memory chip
1 - Hallard's RFM69 ESP Gateway with RFM69W ( https://github.com/hallard/WeMos-RFM69 ) that I assembled.
1 - Wemos D1 mini
1 - Homemade Moteino R4
1 - UART TTL CP2102 with a pin soldered to the RST pinout
1 - 3.7v 2200mah LiPo Battery (3.8v out of the box)
1 - 3.3v Breadboard power Supply
1 - lebson Solar/Battery powered Moteino Shield to power Servo
Arduino IDE
and Lots of TIME

Here's where I'm at....

I've attached the wire antenna and pins to the R6 I purchased from Felix. UPDATE: Disregard the following strikethrough text (I don't know what I'm talking about  :)) I've let smoke out of the breadboard power supply several times. after switching both Moteinos to USB power this behavior stopped. Out of the box when I applied 3.3v via the power supply the on board led would blink once then turn off. I found if I shut off power for 2 seconds and turned it back on the led would blink once every second continuously. And if I cycled the power again for another 2 seconds the led would only blink once again. Power cycle again for 2 seconds and led would go back to blinking once every second, and so on... I'm assuming when the led is blinking once every second it is running a test sketch written onto the Moteino by Felix, I'm guessing the one that increments letters and numbers as it loops through the alphabet ( https://youtu.be/jRVuU7rZqC4 ) UPDATE: This alphabet sketch is the same as the Gateway.ino and Node.ino sketches in the Lowepowerlab Github linked on this post. I'm curious as to what the Moteino is doing on the power cycles when the led blinks only once?

I've uploaded Blebson's  "WeMos-RF-Base.ino" to the (Hallard's) gateway i built (using a USB cable to my computer). And I THINK I uploaded the "RF_Blinds.ino" sketch to the Moteino R6 using a TTL UART CP2102 converter like so,

UPDATE: TESTED OUT THE CP2102 BY UPLOADING FELIX'S BLINK SKETCH TO THE R6. ALL WORKED OUT OK. THE MODIFIED CP2102 IS WORKING FINE WITH THE WIRING BELOW.
    --------------RTS\
   |                         \
------------               \               ----------------
               | -DTR       \--- DTR--|
               |-----RX ---------TX--|
  CP2102  |-----TX----------RX--|      MOTEINO R6
               |-+5V        / ----3V3-|       
               |----GND--/--\          |
               |----3V3 -/     \-GND-|
------------                                -----------------

I originally attempted to connect DTR to DTR but kept getting an Error in the Arduino IDE when uploading a sketch. So I soldered a pin into RTS and gave that a shot. IT WORKED!! I think  ???.
The Arduino IDE said the sketch completed uploading, however, there was no progress bar in the IDE and no blinking lights in the Moteino during the upload?
UPDATE: UPLOAD WORKED, SEEMS NO PROGRESS BAR IS NORMAL. THE ON BOARD LED DID BLINK, I GUESS I JUST MISSED IT.
Is this normal?...  I'm assuming things worked out because when I access the Web server created by the D1 mini and request it to send a command to the Moteino I get a "Success" or "Fail" message (programmed in by Blebson). Strangely enough I get a "Success" message when I have the Moteino R6 connected to the 3v3 breadboard power supply, and get a "Fail" message when the Moteino R6 is connected to the 3.7v 2200mah Lipo Battery (with battery reading 3.8v on the multimeter).

Well..... none of this really matters because I realized I need to slow down and start from the start, one step at a time  ::)

So my next method of action is going to be to attempt to make 2 Moteinos talk to one another. I'm planning to use the 2 R6's that I purchased from Felix for this as I know he test's his boards before delivery. I will attempt to use the Gateway.ino and Node.ino from the Lowpowerlab Github for this ( https://github.com/LowPowerLab/RFM69/tree/master/Examples ). And I also purchased an actual FTDI to usb adapter to be safe. After a successful transfer of data I will attempt to repeat the process with my home made Moteino to test my first attempts at SMD soldering.

UPDATE: The ATmega328p-AU I purchased have no bootloader. I've now purchased a Arduino Uno to copy the Bootloader over to my homemade Moteino (DIY page: http://www.instructables.com/id/Rapid-programming-of-Atmega-328-TQFP-and-DIP-chips/) No Idea what a bootloader is, just know I need one  ;)

Afterwords I'm planning to moving on to attempt communication from the R6 to the (Hallard) RFM69 Gateway using Blebsons sketch (again, I'm worried, not about the sketch, but for the functionality of the board as this is my first SMD creation. Everything seems to light up now, but I'm really not sure what exactly I am looking for to know this is working correctly  :P. And finally I will try to get the home made Moteino talking to the home made RFM69 Gateway, running the same Blebson sketch, for my own personal satisfaction  ;D.

My questions are as follows,

1. Does the Moteino's on board led blink during upload? What am I looking for for visual confirmation that things are working?
ANSWER: Yes it does! It just happens SO FAST. Moteino sketch uploads are fairly quick compared to the Esp8266 using the same IDE.
2. what is the size wire and length for the wire antenna? I need one for the home made Moteino
3. When Running the Gateway and Node sketches, what am I looking for in the Serial Monitor? and do I just select the port in the IDE, and open Serial Monitor to baud 115200?
ANSWER: Yes, upload the Node.ino to one Moteino, and the Gateway.ino to another Moteino (Be sure to adjust the settings in the sketch as explained by Felix for your Moteino's before the upload). Open Serial Monitor at Baud rate 115200 and watch the magic happen. You can select the Port for the sending Moteino to see the info being sent. Or you can switch Ports (in the Arduino IDE) to the receiving Moteino and watch the info display as its being received. Led's on both Moteino's should be blinking each time information is sent from one to the other.
4. If I wrote over the sketch that sends the alphabets and numbers in a loop where can I get a copy of it to upload and play with on the Moteino?
ANSWER: These are the Gateway.ino and Node.ino sketches from the Lowpoowerlab Github page.
5. I have questions about the "failure" message I am getting when running off the battery and the "Success" message when on a power supply, but do not know exactly what I am asking myself, lol. Dont worry about this one. I will come back to this after more testing and a recharge of the battery.

6. Any direction/suggestion you have to help me get started on this journey will be appreciated. Thanks for all your help guys and sorry about the rambling I've been sitting at work for a long time tonight doing nothing!!  ;D







Blue2swing

One last thing! SpaceX's Falcon Heavy is launching today at 1:30pm eastern time. Don't miss it! I know I'm not the only one exited about this :D

LukaQ

Quote from: Blue2swing on February 06, 2018, 08:55:08 AM
Hello Everyone. Im new to the Moteino world and have some questions, but am mainly looking for some direction with getting started. I ordered 2 Moteinos about a Month ago and am just getting around to playing with them. I'v attempted to upload a sketch, written by a different user, to each Moteino but am having no success (Maybe some success.... I'm not sure  ;))

Here's the links for the project I'm following,
Github: https://github.com/blebson/Automated-Blinds
DIY Project Page: https://community.smartthings.com/t/battery-powered-solar-recharged-automated-blinds/99717/1

Here's details on the equipment I have and where I am at so far...
1 - Moteino R6 with a wire antenna accompanied by a RFM69W and on board flash memory
1 - Moteino R6 with a trace antenna, also accompanied with a RFM69W and flash memory chip
1 - Hallard's RFM69 ESP Gateway with RFM69W ( https://github.com/hallard/WeMos-RFM69 ) that I assembled.
1 - Wemos D1 mini
1 - Homemade Moteino R4
1 - UART TTL CP2102 with a pin soldered to the RST pinout
1 - 3.7v 2200mah LiPo Battery (3.8v out of the box)
1 - 3.3v Breadboard power Supply
1 - lebson Solar/Battery powered Moteino Shield to power Servo
Arduino IDE
and Lots of TIME

Here's where I'm at....

I've attached the wire antenna and pins to the R6 I purchased from Felix. Out of the box when I applied 3.3v via the power supply the on board led would blink once then turn off. I found if I shut off power for 2 seconds and turned it back on the led would blink once every second continuously. And if I cycled the power again for another 2 seconds the led would only blink once again. Power cycle again for 2 seconds and led would go back to blinking once every second, and so on... I'm assuming when the led is blinking once every second it is sending a test sketch written onto the Moteino by Felix, I'm guessing the one that increments letters and numbers as it loops through the alphabet ( https://youtu.be/jRVuU7rZqC4 ). I'm curious as to what the Moteino is doing on the power cycles when the led blinks only once?

I've uploaded Blebson's  "WeMos-RF-Base.ino" to the (Hallard's) gateway i built (using a USB cable to my computer). And I THINK I uploaded the "RF_Blinds.ino" sketch to the Moteino R6 using a TTL UART CP2102 converter like so,

UPDATE: TESTED OUT THE CP2102 BY UPLOADING FELIX'S BLINK SKETCH TO THE R6. ALL WORKED OUT OK. THE MODIFIED CP2102 IS WORKING FINE
    --------------RTS\
   |                         \
------------               \               ----------------
               | -DTR       \--- DTR--|
               |-----RX ---------TX--|
  CP2102  |-----TX----------RX--|      MOTEINO R6
               |-+5V        / ----3V3-|       
               |----GND--/--\          |
               |----3V3 -/     \-GND-|
------------                                -----------------

I originally attempted to connect DTR to DTR but kept getting an Error in the Arduino IDE when uploading a sketch. So I soldered a pin into RTS and gave that a shot. IT WORKED!! I think  ???.
The Arduino IDE said the sketch completed uploading, however, there was no progress bar in the IDE and no blinking lights in the Moteino during the upload?
UPDATE: UPLOAD WORKED, SEEMS NO PROGRESS BAR IS NORMAL.
Is this normal?...  I'm assuming things worked out because when I access the Web server created by the D1 mini and request it to send a command to the Moteino I get a "Success" or "Fail" message (programmed in by Blebson). Strangely enough I get a "Success" message when I have the Moteino R6 connected to the 3v3 breadboard power supply, and get a "Fail" message when the Moteino R6 is connected to the 3.7v 2200mah Lipo Battery (with battery reading 3.8v on the multimeter).

Well..... none of this really matters because I realized I need to slow down and start from the start, one step at a time  ::)

So my next method of action is going to be to attempt to make 2 Moteinos talk to one another. I'm planning to use the 2 R6's that I purchased from Felix for this as I know he test's his boards before delivery. I will attempt to use the Gateway.ino and Node.ino from the Lowpowerlab Github for this ( https://github.com/LowPowerLab/RFM69/tree/master/Examples ). And I also purchased an actual FTDI to usb adapter to be safe. After a successful transfer of data I will attempt to repeat the process with my home made Moteino to test my first attempts at SMD soldering.

UPDATE: The ATmega328p-AU I purchased have no bootloader. I've now purchased a Arduino Uno to copy the Bootloader over to my homemade Moteino (DIY page: http://www.instructables.com/id/Rapid-programming-of-Atmega-328-TQFP-and-DIP-chips/) No Idea what a bootloader is, just know I need one  ;)

Afterwords I'm planning to moving on to attempt communication from the R6 to the (Hallard) RFM69 Gateway using Blebsons sketch (again, I'm worried, not about the sketch, but for the functionality of the board as this is my first SMD creation. Everything seems to light up now, but I'm really not sure what exactly I am looking for to know this is working correctly  :P. And finally I will try to get the home made Moteino talking to the home made RFM69 Gateway, running the same Blebson sketch, for my own personal satisfaction  ;D.

My questions are as follows,

1. Does the Moteino's on board led blink during upload? What am I looking for for visual confirmation that things are working?
2. what is the size wire and length for the wire antenna? I need one for the home made Moteino
3. When Running the Gateway and Node sketches, what am I looking for in the Serial Monitor? and do I just select the port in the IDE, and open Serial Monitor to baud 115200?
4. If I wrote over the sketch that sends the alphabets and numbers in a loop where can I get a copy of it to upload and play with on the Moteino?
5. I have questions about the "failure" message I am getting when running off the battery and the "Success" message when on a power supply, but do not know exactly what I am asking myself, lol. Dont worry about this one. I will come back to this after more testing and a recharge of the battery.

6. Any direction/suggestion you have to help me get started on this journey will be appreciated. Thanks for all your help guys and sorry about the rambling I've been sitting at work for a long time tonight doing nothing!!  ;D
1. I don't think so, you might want to check videos from Felix, where moteino is visible.
2. Wire size will have to be pretty much the one you can find and you can solder it to moteino. Length will be dependent on your freq. you will use. There are at least 433,868 and 915MHz, which one do you have?
3. Yes. One side will print very little each time, I think it prints "Ok!". Other side will receive "123 ABCDEFGHIJKLMNOPQRSTUVWXYZ" like
1
12
123
1234......

4 and 5 I can't help

And one more thing, if you don't have 8MHz moteino (which doesn't have onboard regulator), you really should supply it with 5v (if you have standard moteino, which has regulator onboard)

Blue2swing

Thank you LukaQ. Im using the RFM69W 915MHz. The wire antenna Felix provided with the R6 I purchased is Copper, about 3 inches long, and maybe 26awg. Being almost completely clueless about these radios am not sure if there is something special I should look for when making a similar antenna for my home made Moteino R4? If you have the exact length and wire gage I would appreciate it!!

Right now I have 2 Moteino R6's communicating with each other using the Gateway.ino and Node.ino sketches. These little led's are just flashing away like crazy. It's quite the light show  ;D, and very rewarding after so much exciting work! Now I'm regretting having to replace the sketches to move forward and attempt to communicate with the Esp-Wemo-D1 mini Gateway (with attached RFM69W 915MHz).  :'(

LukaQ

#4
Quote from: Blue2swing on February 06, 2018, 12:30:20 PM
Thank you LukaQ. Im using the RFM69W 915MHz. The wire antenna Felix provided with the R6 I purchased is Copper, about 3 inches long, and maybe 26awg. Being almost completely clueless about these radios am not sure if there is something special I should look for when making a similar antenna for my home made Moteino R4? If you have the exact length and wire gage I would appreciate it!!

Right now I have 2 Moteino R6's communicating with each other using the Gateway.ino and Node.ino sketches. These little led's are just flashing away like crazy. It's quite the light show  ;D, and very rewarding after so much exciting work! Now I'm regretting having to replace the sketches to move forward and attempt to communicate with the Esp-Wemo-D1 mini Gateway (with attached RFM69W 915MHz).  :'(
wire size not that important, length very, copy it over to new one(s). Length will be the same on all of them, if all (of course) are the same freq. at 915MHz. You can use about the same gauge of wire +/- size.

I know what you mean, yes :D BUUT, now you get to work on something you will have use of. You can always buy or make more moteinos, then fun get to a next level.
I have few running for almost a year, but I still have two spare I can experiment with, mostly wit different antennas (dipoles, not just monopoles like you have now wit simple wire)
The best thing is, now that you have one thing working, you can reprogram them to something new, maybe even PI gateway to collect data

There are so many things you can do, like read temp. inside/outside, humidity, pressure, power consumption read from meter (if you live in house), water consumption and much more like turning on/off lights... I'm just saying, what you have working now is nothing compared to what you can have

Felix

Blue2swing, welcome to the forum, sounds like you're having fun!  :)
Sorry I'm late to the thread, looks like lots of your initial questions were addressed or figured out, if you can recap anything outstanding that you need any help with, that would be great.
Thanks!

sparky

Quote from: Blue2swing on February 06, 2018, 09:35:47 AM
One last thing! SpaceX's Falcon Heavy is launching today at 1:30pm eastern time. Don't miss it! I know I'm not the only one exited about this :D

Thanks for the reminder!

Blue2swing

@LukaQ Thanks again! That's exactly what I needed to know. I'll match the length to the wire antenna I already have. And I know what you mean about finding many uses for these things. I first found out about Raspberry Pi's 2 years ago and used one to control my old home alarm system with my phone by using Nodejs. While doing further research on the Raspberry Pi's I kept running into this thing called an Arduino. So I bought a couple and ended up making a remote garage door lock (of which I bought and connected all the components myself. No breadboard, just 3d printed a box with slots to hold all the components and soldered and screwed everything together). While doing research on the Arduino I ran into this thing called a Moteino, which led me here. Now I'm trying to see what I can learn and create in the process.

I know I'm late to the microprocessor game, but I'm having a lot of fun trying to catch up with everyone else  :)


@Felix, Thanks for any help you can provide and for making such a cool little board. I think I've figured out the answer to most of my own questions this morning while waiting for the Falcon Heavy to launch. The step I'm having difficulty with right now is having the Wemos D1-mini (esp8266) talk to the (Hallard) RFM69W Gateway shield so it can send a message via RFM to a Moteino running the same frequency Radio. I may have to direct this question directly to Hallard himself. I believe he's got a blog at https://hallard.me/, and I've seen his post's at mySensors. Or I could also ask Blebson, since he has figured it out already, as he wrote the sketch that I'm using. My only concern is that my Gateway board is Not functioning completely. I'm new to Hot air soldering and heated up the board quite liberally when soldering the SMD components. It was only after I was done that by chance I came across a video on youtube advising that excessive heat can damage SMD components. So, If you have any advice on troubleshooting SMD components on and off a board I'm sure that is knowledge that will stay with me for years to come!! Plus, I'm sure I'm going to have ton's of coding questions as I continue to progress with this new hobby.


@sparky, wasn't It amazing!!??  ;D. Watching that rocket launch made me feel like a little kid looking up at the stars again.




sparky

Quote from: Blue2swing on February 06, 2018, 05:32:42 PM
@sparky, wasn't It amazing!!??  ;D. Watching that rocket launch made me feel like a little kid looking up at the stars again.

Yes it was, I love that stuff

Felix

Blue2swing,
Thanks for the feedback, appreciated :)
And you're at the right place to learn, the internet :)
Besides, this little corner here (LPL site and forums) can be at least a little helpful in all subjects of electronics.

With SMD it's a steep learning curve. With soldering in general, too much heat too long would damage a component. Getting that skill to heat enough, uniformly, to make a great solder joint or get something desoldered, takes time and patience, and some screw ups. But it's fun!

BTW congrats for your other earlier projects!

LukaQ

#10
As it turns out (kinda forgot)
I have BME and BMP 280 on wemod d2 with rfm69hw

Since arduino IDE is that great already, you can make your sketch work on moteino, then probably without problem use it on D1 mini.
What I don't know is, why will you use that gateway? will that be your endpoint, serve webpage or send data somewhere? you won't use PI?

Blue2swing

#11
@LukaQ, the D1 mini's web server is accessed by my Smartthings home automation system, and the smart automation system is connected to my Amazon echo. So with my voice I tell Alexa to open the blinds, Alexa will send a command to the smartthings hub advising to close the blinds, Smartthings will access a specific webpage address on the esp D1 mini's server that lets it k ow the blinds need to be closed, the D1 mini then tells the gateway to send the command via 915MHz RF to the moteino mounted inside my home blinds, and the moteino receives the command and runs a servo to close the blinds. The whole thing has been organized and set up by User Blebson. It's a nice little set up I'm trying to replicate :). Which reminds me, I need to email him about my trouble with the gateway shield and see what he thinks .

LukaQ

Ah I see, wifi gateway then. In the end it's not that important if it is endpoint or not, as long you it delivers data correct way.

Blue2swing

#13
Thanks LukaQ for all your help and everyone else who has pitched in! I continued to trouble shoot my project today and was able to figure out that the ESP Gateway is working perfectly! :)!! I'm so EXCITED.

And after more tinkering I was finally able to get the servo to move by accessing an Http address on the ESP's web server.

But I'm still not out of the woods yet ;).

I was only able to successfully replicate Blebsons project when the moteino was powered by a breadboard power supply (3.3v), but not when powered with a 3.7v lipo battery (to Vin). What I ended up doing was placeing the moteino on the breadboard with jumper wires from Vin and Gnd to the breadboard power supply. Then I used about 30 more jumper wires to connect all additional inputs and outputs to Blebsons shield. I connected the Lipo battery and the solar panel to the shield, connected All the grounds together from all power sources (lipo, solar panel, breadboard power supply). At first there was still nothing, so I started testing by removing one wire at a time and retrying to send a message. I found out when the D3 pin is connected from the shield to the moteino the RFM69W stops communicating. But when D3 is not connected everything WORKS PERFECTLY!! Servo moves, I get a "Success" message back from the web server along with battery voltage readings, and charging status! Then I reconnect a jumper from D3 on the shield to D3 on the moteino and FAILURE again :(.

So I realized 2 things.... Possibly 1 thing ( they may both be connected). 1) I'm pretty sure these 3.7v 2200mah 8.14Wh (E435583) Lipo battery's I bought on eBay may be the problem. 2) pin D3 on the shield sends an interrupt signal to D3 on the Moteino to wake it when a toggle switch is pressed. I think D3 is being accidentally activated due to power leakage At a NPN transistor that may possibly be interrupting the RFM69W from working correctly... (I don't know, this second one is a wild guess for now. At least till I can do some more reading on the matter and additional testing. But my gut is telling me the problem is just the battery and nothing more. I'm hoping when I try a different battery (possibly several Duracell alkaline just for a temp test) the issue with pin D3 resolves on its own.

So my question for anyone who is listening is,
1.what kind of battery would you recommend for a moteino?
2. Is there anything to look out for? Anything to stay away from?
3. My Lipo battery continuously reads 3.8v after 2 days of testing. Is there any reason I should assume that the actual voltage is much lower? I get the feeling it's lower because the moteino works great on the lower 3.3v power supply, and the onboard LDO is putting out 3.3v when the battery is connected, but still the radio fails to connect. :(

Thanks again guys :)! This is a lot of fun. I may be spending too much time on this project and neglecting the outside world. lol. Anyone else have that problem, or is it just me?


Felix

Quote from: Blue2swing on February 08, 2018, 07:39:30 AM
But I'm still not out of the woods yet ;).

I found out when the D3 pin is connected from the shield to the moteino the RFM69W stops communicating. But when D3 is not connected everything WORKS PERFECTLY!! Servo moves, I get a "Success" message back from the web server along with battery voltage readings, and charging status! Then I reconnect a jumper from D3 on the shield to D3 on the moteino and FAILURE again :(
Maybe something Blebson can address since it's his shield design? maybe PM to report the issue and invite him to the conversation?

Quote from: Blue2swing on February 08, 2018, 07:39:30 AM
So I realized 2 things.... Possibly 1 thing ( they may both be connected). 1) I'm pretty sure these 3.7v 2200mah 8.14Wh (E435583) Lipo battery's I bought on eBay may be the problem. 2) pin D3 on the shield sends an interrupt signal to D3 on the Moteino to wake it when a toggle switch is pressed. I think D3 is being accidentally activated due to power leakage At a NPN transistor that may possibly be interrupting the RFM69W from working correctly...  I'm hoping when I try a different battery (possibly several Duracell alkaline just for a temp test) the issue with pin D3 resolves on its own.
I suggest doing more empirical testing on that. I don't have reasons to believe a battery should cause this. At least get an opinion from the creator of the shield. Otherwise a scope would help a lot in seeing what's going on with D3. Make sure the interrupt is setup according to the HIGH/LOW transition of the interrupt signal edge transition.
[/quote]

Quote from: Blue2swing on February 08, 2018, 07:39:30 AM
So my question for anyone who is listening is,
1.what kind of battery would you recommend for a moteino?
2. Is there anything to look out for? Anything to stay away from?
3. My Lipo battery continuously reads 3.8v after 2 days of testing. Is there any reason I should assume that the actual voltage is much lower? I get the feeling it's lower because the moteino works great on the lower 3.3v power supply, and the onboard LDO is putting out 3.3v when the battery is connected, but still the radio fails to connect. :(
1. Anything that works for your requirements. Lipos are great energy density, but chinese ones can act up at extreme temps (also a hazard if charged at high currents). They don't like freezing, see my blog for that. If you plan to power Moteinos for low power, choose something above the LDO 3.3v+dropout, stay at least above 3.6V, otherwise it will work but drain a few hundred uA more than usual.
2. Stay away from hazardous batteries if you can, if budget permits, and if requirements dictate it. Otherwise lipos are popular and work OK in most conditions, charge them gently etc.
3. I don't think so. How do you read the battery?