Recent Posts

Pages: [1] 2 3 ... 10
1
Coding questions / Compiling error on M4 vs M0 and AVR.
« Last post by shownet on October 16, 2021, 06:21:37 PM »
I don't believe this issue is Moteino specific, but I did discover it because I'm working on two different Moteino boards.

I have 100 Moteino's (trace antenna) and 3 RFGateway (M4) gateways. I started using a library, SafeString (https://www.forward.com.au/pfod/ArduinoProgramming/SafeString/index.html) to handle string tokens and serial communication. I first wrote it with the Meteino AVR board definition, it compiles fine, but oops that's not the platform I need, I need it on the RFGateway M4. Change board definition, and now I get a slew of errors, this is the top and bottom portions:

Code: [Select]
In file included from C:\Users\micha\OneDrive\Documents\platformIO\Projects\test adafruit arduino\lib\SafeString\examples\SafeStringReader_GPS\SafeStringReader_GPS.ino:17:0:
C:\Users\micha\OneDrive\Documents\Arduino\libraries\SafeString\src/SafeStringReader.h:46:44: error: expected class-name before '{' token
 class SafeStringReader : public SafeString {
                                            ^
C:\Users\micha\OneDrive\Documents\Arduino\libraries\SafeString\src/SafeStringReader.h:49:41: error: expected ')' before '&' token
     explicit SafeStringReader(SafeString& _sfInput, size_t bufSize, char *tokenBuf, const char* _name, const char* delimiters, bool skipToDelimiterFlag = false, uint8_t echoInput = false, unsigned long timeout_mS = 0 );
                                         ^
C:\Users\micha\OneDrive\Documents\Arduino\libraries\SafeString\src/SafeStringReader.h:50:41: error: expected ')' before '&' token
     explicit SafeStringReader(SafeString& _sfInput, size_t bufSize, char *tokenBuf, const char* _name, const char delimiter, bool skipToDelimiterFlag = false, uint8_t echoInput = false, unsigned long timeout_mS = 0 );
                                         ^
C:\Users\micha\OneDrive\Documents\Arduino\libraries\SafeString\src/SafeStringReader.h:157:36: error: declaration of 'operator=' as non-function
     SafeStringReader & operator = (SafeString &rhs);
.
.
.
.
C:\Users\micha\AppData\Local\Arduino15\packages\Moteino\hardware\samd\1.6.3\cores\arduino/Print.h:84:12: note:   no known conversion for argument 1 from 'SafeStringReader' to 'double'
C:\Users\micha\AppData\Local\Arduino15\packages\Moteino\hardware\samd\1.6.3\cores\arduino/Print.h:85:12: note: candidate: size_t Print::println(const Printable&)
     size_t println(const Printable&);
            ^~~~~~~
C:\Users\micha\AppData\Local\Arduino15\packages\Moteino\hardware\samd\1.6.3\cores\arduino/Print.h:85:12: note:   no known conversion for argument 1 from 'SafeStringReader' to 'const Printable&'
C:\Users\micha\AppData\Local\Arduino15\packages\Moteino\hardware\samd\1.6.3\cores\arduino/Print.h:86:12: note: candidate: size_t Print::println()
     size_t println(void);
            ^~~~~~~
C:\Users\micha\AppData\Local\Arduino15\packages\Moteino\hardware\samd\1.6.3\cores\arduino/Print.h:86:12: note:   candidate expects 0 arguments, 1 provided
exit status 1
'sfReader_SF_INPUT' was not declared in this scope

These particular errors actually aren't from attempting to compile my code, they're from a sample sketch included in the library (sorry I can't find a link directly to it). Other samples also produced errors.

I found when I selected a randomly sampling of boards, most if not all AVR and M0 boards compiled fine, but no M4 boards would compile. Any ideas?




2
Thanks for the closure.
3
I figured it out - a bad solder connection on the RFM69CW. Attached is a photo of the bad joints. If I put pressure there, the ACKs work.
I'm not sure why this caused a problem for the ACKs and not the normal sending and receiving - do ACKs use a different interrupt mechanism perhaps? In any case, it works now!
4
RF - Range - Antennas - RFM69 library / Re: Noobie questions about RF, RFM69, RFM95 etc
« Last post by lygho on October 13, 2021, 08:08:42 AM »
Just went through some links you sent and the powerlab website, I think I'll get there with the info I found, thank you!
5
CurrentRanger / Re: Battery p/n and mAh rating for CurrentRanger
« Last post by Ben_QC on October 13, 2021, 08:03:33 AM »
Hi Felix,

Thanks for the response.

Ben
6
RF - Range - Antennas - RFM69 library / Re: Noobie questions about RF, RFM69, RFM95 etc
« Last post by lygho on October 13, 2021, 07:20:10 AM »
Welcome!
So you're not a rocket scientist but you want a rocket eh? ;)

We could write a book with a chapter to answer each of your questions but not sure how helpful that would be. Let me attempt my best fast 2 cents to point in the "right" direction, in my own biased opinion.

I would start simple and learn your way using good tools and hardware, unless you have infinite time to burn. For your purposes the RFM69HCW is the way to go - 868-915mhz will work in most places and antennas are smaller and more manageable. The simple monopole wire kept perpendicular on the PCB will give you optimal signal, and will worsen if its bent or deformed in case space doesn't allow for optimal placement. The internet is full of resources on RFM69. There are several libraries to go with it, but I can only speak to the one I created and I support and which works on the boards I make.

IMO it's the most frustrating thing to waste days on end with DIY/breadboard/arduino UNO + RFM69 hardware only to discover you missed something obvious or not so obvious (albeit some call it a learning experience!). I would instead start with a pair of boards that are known to work. I designed the Moteino for this purpose, there are many types to choose from. When you get into hardware you will need to do some soldering, unavoidable, get ready for it and get decent tools.
Any 2 boards with the same transceiver type can communicate between them, they are both transmitter and receiver (transceiver!). Their processor and board format is simply a matter of options and processing power and/or connectivity. For instance the RFGateway is a fast board meant to plug right into a Pi and act as a gateway to a network of many remote/battery nodes. On the other end of simple and low power boards are the AVR based Moteinos, they can sip power and last for years when programmed correctly for that purpose, examples offered in the RFM69 library.

While you can directly connect a RFM69 to the Pi and avoid the "middle man" of another board and expense, I would highly advise against that, unless youre on top of everest with only a Pi and RFM69 and your life depends on it. Python is not really for programming hardware although efforts have made it relatively easy to do so. Get started with Arduino IDE and working examples, then work your way from there.
Rocket scientists aren't born but made, I'll get there eventually :D
I'll follow your advice and get started with some setups used in online examples (and the ones you mentioned) to get how things work. I'll also take a look at Moteino. I do it for the learning experience and the actual application is only a secondary objective, so it's ok if I get there going through other setups first.
I was trying to stick to Raspberry Pi stuff but guess I'll just have to get over it and get into Arduino first ^^

Thanks for the advice, I think I have a better idea of how I should get started with this. Just two last questions:

How different is Arduino IDE compared to something like (micro)Python and how easily can I transfer what I learn in one to the other (like is the code to make a LED blink similar in Arduino compared to python or do they use completely different approaches to this)?

You mention "Any 2 boards with the same transceiver type can communicate between them", by "type" do you mean RFM69 vs RFM95 as different types or more like the frequency they use?
7
CurrentRanger / Re: Battery p/n and mAh rating for CurrentRanger
« Last post by Felix on October 12, 2021, 05:07:39 PM »
That there are many, it's a good thing. Choose something local that won't take 3 months to ship from our commie friends.
The problem with providing a specific link is they can be valid for a week and then be gone.

Anything between say 500-2000mAh is sufficient, you're more concerned about the size to ensure they fit inside the box, and the JST PH2.0 connector to be the right polarity (although it's relatively easy to swap the 2 wire/connectors inside the connector housing (ex. with tweezers) to ensure correct polarity.

For instance Welectron sells a 503035 (3.7V, 500mAh) battery to accompany the CurrentRanger, but also there is a 1500 and 2500mAh option.
8
RF - Range - Antennas - RFM69 library / Re: Noobie questions about RF, RFM69, RFM95 etc
« Last post by Felix on October 12, 2021, 05:00:20 PM »
Welcome!
So you're not a rocket scientist but you want a rocket eh? ;)

We could write a book with a chapter to answer each of your questions but not sure how helpful that would be. Let me attempt my best fast 2 cents to point in the "right" direction, in my own biased opinion.

I would start simple and learn your way using good tools and hardware, unless you have infinite time to burn. For your purposes the RFM69HCW is the way to go - 868-915mhz will work in most places and antennas are smaller and more manageable. The simple monopole wire kept perpendicular on the PCB will give you optimal signal, and will worsen if its bent or deformed in case space doesn't allow for optimal placement. The internet is full of resources on RFM69. There are several libraries to go with it, but I can only speak to the one I created and I support and which works on the boards I make.

IMO it's the most frustrating thing to waste days on end with DIY/breadboard/arduino UNO + RFM69 hardware only to discover you missed something obvious or not so obvious (albeit some call it a learning experience!). I would instead start with a pair of boards that are known to work. I designed the Moteino for this purpose, there are many types to choose from. When you get into hardware you will need to do some soldering, unavoidable, get ready for it and get decent tools.
Any 2 boards with the same transceiver type can communicate between them, they are both transmitter and receiver (transceiver!). Their processor and board format is simply a matter of options and processing power and/or connectivity. For instance the RFGateway is a fast board meant to plug right into a Pi and act as a gateway to a network of many remote/battery nodes. On the other end of simple and low power boards are the AVR based Moteinos, they can sip power and last for years when programmed correctly for that purpose, examples offered in the RFM69 library.

While you can directly connect a RFM69 to the Pi and avoid the "middle man" of another board and expense, I would highly advise against that, unless youre on top of everest with only a Pi and RFM69 and your life depends on it. Python is not really for programming hardware although efforts have made it relatively easy to do so. Get started with Arduino IDE and working examples, then work your way from there.
9
CurrentRanger / Battery p/n and mAh rating for CurrentRanger
« Last post by Ben_QC on October 12, 2021, 03:21:41 PM »
Hi all, new here.

I understand that for the CurrentRanger, the website indicates to use a 3.7V Li-Po or Li-Ion that charges to 4.2V via MCP73831 IC with a 454mA charge current.

But what does this correspond to in terms of battery? When searching online for Li-Po or Li-Ion batteries on Amazon for example, there are pages and pages of these types of batteries...

So... does anyone have a specific part number with a direct link to a known working battery that they have personally tested with the CurrentRanger?

On Amazon, I see like PL505573 @ 2500mAh or LP503040 @ 600mAh or PL583450 @ 1500mAh... so which one should I get?

Thanks!

Ben
Canada
10
RF - Range - Antennas - RFM69 library / Noobie questions about RF, RFM69, RFM95 etc
« Last post by lygho on October 12, 2021, 11:08:57 AM »
Hi everybody, glad to join you all in this forum.

I hope my post is in the correct section, if not let me know.

TL;DR:
Want to make wireless battery powered sensor for my home communicating with a raspberry pi 4B.
RFM modules? please help! I have no idea what I'm doing ^^

Some background before my question:
I have no background whatsoever in coding (except some minor interest over the last few years), any hardware or electronics or anything that has to do with sensors and signals. I started learning python a month or two ago, then recently discovered raspberry pi with which I was able to set up a local server. What I would like to try next is using this raspberry pi (4B) to communicate with sensors spread in my house measuring temperature and humidity. I've looked over the internet over the last few days and keep finding "better" ways to do it, so I hope to finally find out how I should proceed exactly :)
My initial plan was using ESP32 linked to a DHT22 sensor sending data to my server through wifi. As I want to be able to move them around and place them whereever I want I wanted to use battery power. I then realised battery life of a ESP32 (using a 2-3000 mA 3.7V battery) is usually not so great. I then discovered LoRa networks and ended up with the idea of using a  SeeedStudio WM1302 LoRaWAN HAT for Raspberry Pi (connected to the pi obviously) getting data from a microprocessor (probably raspberry pi pico) linked to my sensor and a RFM95 module.
However, I finally ended up on this forum where it was mentioned RFM95 is usually for very long range and RFM69 should do the job just fine.

So now, I am completely confused. So here are my questions, any advice concerning my project is also welcome:

- Is the WM1302 LoRaWAN HAT "compatible" with RFM69 (and is it with RFM95)? I suppose they should use a similar frequency?

- Are modules like the RFM69 able to both receive and transmit data or do I need special versions to transmit/receive signal?

- I saw there are several RFM69 versions (C,CW,HW,HCW), what are the differences exactly? I found this answer (https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/difference-between-rfm69-w-and-cw-(or-hw-and-hcw)/) which helps a bit but leads to the questions: If I understand correctly dBm correlates to the power thus the range of the module? Also, there is a mention of different pin-out, how does this affect compatibility with a pico microprocessor for example?

- Are all the modules mentioned programable with python?

- I saw many mentions of arduino in my search, is it perfectly possible to have a remote sensor using arduino parts communicating with my raspberry pi 4B? Also, is any RFM module compatible with both arduino/raspberry etc or could there be some issues when I try to combine them into a remote sensor?

- Finally, I currently already have the raspberry pi 4B, the ESP32 (with integrated 3.7V battery power supply) and a DHT22 sensor (I ordered the last two before learning about LoRa). Any suggestions on how you would tackle making wireless battery-powered sensors (with or without any of the components mentiond) are always welcome!

Thanks for taking the time to go through my questions and feel free to redirect me to sources that have the answers or more info on basic concepts that might help me.
Pages: [1] 2 3 ... 10