@NeverDie I am happy to report that my batteries arrived yesterday!

OldSurferDude
@OldSurferDude
Best posts made by OldSurferDude
-
RE: What's a good power bank for use with IoT?
-
RE: What's a good power bank for use with IoT?
@NeverDie
I'm going to dissipate the energy through a 25 ohm resistor. It will take about 24 hours to perform one capacity test. Often times I read that the full capacity won't be available until after a few charge-discharge cycles. 2 resistors, 4 batteries, 3 tests each. Assuming that I stay on top of it, it will take at least a week of testing which won't start until I get my 25 ohm resistors. I'll post a link to my full write up. -
RE: What's a good power bank for use with IoT?
OK, I did my battery test. @NeverDie @Nca78 @mfalkvidd
You can find it hereThe batteries from Newegg and Fullbattery are good ones.
If you going to buy a large quantity and looking for a low price, then you should buy 1 or two and test them as I have done here. You might have to "kiss a lot of toads" before you find a good vendor, though.
OSD
-
RE: Saving last known good state, but not in EEPROM
@eiten said in Saving last known good state, but not in EEPROM:
This is exactly what I am seeking! Thank you!
PS I truly enjoy reverse translating! It teaches me how to better understand my first language and it gives me alternate words to use in searches. So a second thank you!
"Regelmässiges Zurücksetzen" would be best translated to English in this context as "Periodic Reset". In the English version of Home Assistant it is called "Meter reset cycle" (I remember seeing "keep dry" translated as "do not take in shower with you"
-
RE: Beginner concept question for serial communication
@hubertus I'm not getting the description of you setup. Perhaps a sketch would be good?
Wen I need serial communication, with the Arduino, I use SoftwareSerial on two other I/O lines. That way I can debug real time, SoftwareSerial is slower but you're only doing temperature so 9600BAUD would be fin
Also, don't try to do too much at once. Break the task down into small, manageable sections. You have a lot of different things going on, get one thing going at a time.
OSD
-
RE: What's a good power bank for use with IoT?
@NeverDie I like your suggestion for solar panels, though my application only requires 1x 5W panel. And I like the idea of dismantling the power packs.
I think we differ in our approaches, though. I seem to enjoy living on the "bleeding edge", that is, I'm more of a risk taker. My first house solar system, 2.8kW, was installed in 2004. When I upgraded to 4.2kW, I took the 14 panels and installed them on my hillside, so now I'm a net energy exporter. The 2.8kW portion is still producing at 85% of nameplate, shows little environmental degradation (sealant, too), and has paid for itself. The reward outweighed the risk.
In taking risks, I learn much. Yes, I have a quite a few scars, actually and metaphorically. I have discovered a philosophy: Everything is an experiment. The point of an experiment is to learn something. So every experiment is a successful, just that sometimes the desired results are not realized. Eg. leaving an Arduino outdoors results in a short useful life. Spraying on a sealant extends the outdoor life.
Good discussion. Thanks for the ideas
OSD
-
RE: Where did everyone go?
I'm new-ish to MySensors. I came here because I was looking for a gateway from RF24 to MQTT and I'm well on my way to getting the MySensors version to work.
Why isn't MySensors working? I find two things really frustrating. The documentation is spotty at best. It's taking me days to get as far as I have. When I write up my own procedure for my own documentation, I find it's maybe just 20 steps, but each step needs a detailed explanation. For example, through a lot of trial and error, I found that to turn on the relay in the relay with button example I had to publish a message of 1 to the MQTT topic mysensors-in/13/1/V_LIGHT/0/2. Only later did I find the Serial Protocol 2.x. But it does't show a V_LIGHT nor S_LIGHT. Yes, I figured out that example is out of date, but that's part of the point I'm trying to make. And how did my node ID become 13 and stay 13 when I press reset on the Arduino?
You can see more detail on my frustrations in the MQTT gateway discussion
Which segues into my other frustration. about documentation. Many members offering advice do not provide links to their statements. For example, in the MQTT gateway discussion:
gohangohan MOD 3 Sept 2017, 13:15
(at)Richard-van-der-Plas "Just clone the 2.2 dev instead of the stable, the rest is the same
(emphasis mine)How does one do that? Particularly in a world where case is important and there are three different quote marks, (excuse me, one is sometimes known as a gravé) all with different meanings.
There are many like you @NeverDie who know MySensors in-and-out. I am an experienced hardware and software engineer, retired (one of the engineers that developed ink jet printing and one of the engineers that developed a navigation system for the 747) It's not like I don't have a fundamental understanding of what's going on here. I have yet to find a way to search the forum other than using google search.
Don't get me wrong, the MySensors concept is great and functions pretty well, but if it's not well documented, then it is useless. Then when someone asks a simple questions only to get an answer with no explanation of the how, the newbie and experienced alike don't bother with the forum because the forum offers no help, either.
We had a poster at HP (when it was a great company) "No job is done until the paperwork is complete" (image of person sitting on the toilet)
-
RE: What did you build today (Pictures) ?
@NeverDie It is my understanding, though I can't wrap my head around it, that it is the length of the conductor that makes the antenna tuned to a certain frequency. If this is the case, you could run your antenna around the edge of your circular pcb which would make the effective radius only slightly bigger.
-
RE: How to optimise a code (95% memory used)
I found that timelib.h uses a tremendous amount of memory. You avoid using it by getting time string from the controller.
I have also found that when you're using that amount of memory that bad things happen, as you noted. I use global variables to avoid the transient nature of function variables.
I'll be looking forward to other comments as, I, too, do not know all the tricks;)
OSD
-
RE: What I must buy in order to measure mAh please
@DenisJ Are you measuring a USB device? Look at something like this https://www.aliexpress.com/item/33019457512.html?gps-id=pcDetail404&scm=1007.16891.96945.0&scm_id=1007.16891.96945.0&scm-url=1007.16891.96945.0&pvid=824c24fa-034b-4801-b51d-50b2ad877945&_t=gps-id:pcDetail404,scm-url:1007.16891.96945.0,pvid:824c24fa-034b-4801-b51d-50b2ad877945,tpp_buckets:668%230%23131923%2330_668%230%23131923%2330_668%23888%233325%239_668%23888%233325%239_668%232846%238110%231995_668%232717%237561%23332__668%233374%2315176%2335_668%232846%238110%231995_668%232717%237561%23332_668%233164%239976%23761_668%233374%2315176%2335
(AliExpress: Cheap prices and one could question the quality, but for the most part they work. Shipping takes about a month. rarely faster)
Latest posts made by OldSurferDude
-
RE: Nb of possible nodes in a mysensors networks with domoticz
@Sasquatch
Because I have the exact same code for all same devices, I need to predefine the node ID. Your method is to run simple code with MY_NODE_ID set so that this sets the EEPROM. I like it, though I'm a little uncomfortable with it in that I am uncertain that MySensors won't change it...I can get comfortable with it. But it's still running some simple code before loading the real code. And, the gateway has to be up and running.If one is comfortable with MySensors taking the NodeID from the EEPROM, then my code to get the NodeID in the "real" program is redundant.
I think I did this because I was re-using my Arduinos and was unaware of the "MySensors gets new node only if address 0 is 0xFF". I got frustrated that I was getting duplicate node IDs, so I forced the issue.
In the future, I will make a note in my comments something like:
/* MySensors gets NODE_ID from address 0 of the EEPROM. If this value is 0xFF a random NODE_ID will be assigned */
Thanks for making it clear for me.
Now I remember ...
I booted up a 10 device system, all with 0xFF and the MySensors nettwork went bonkers, Most of the nodes had to go through repeater nodes (default is set to make nodes repeaters) and these repeater nodes stole the data because they had the same temporary address. Sometimes it would take hours for the MySensors network to get it all sorted out.
-
RE: Nb of possible nodes in a mysensors networks with domoticz
@Sasquatch I do see what you mean about RTFM. Of course, that's the way one would do it if one only had one or two devices. My suggestion was biased by my situation
I have 7 nodes that have identical code except for the node number. The location of the sensor and the node number are linked and I keep track of these. The challenge is that when I update the code, I would have to compile it 7 times. But if the node number is in the EEPROM, I only have to compile it once. (My code takes several minutes to compile.)
This is how I upload the code multiple times without compiling multiple times:
With [in Preferences] Show verbose output during ... upload checked, I compile and upload to one of my devices. I capture the third line which looks something like:
"C:\Users\**user**\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\**user**\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM14" -b115200 -D "-Uflash:w:C:\Users\**user**\AppData\Local\arduino\sketches\B27BE0BD09045C16054140637AB4EF50/Blink.ino.hex:i"
Then I export the binary (sketch--.export compiled binary or <ctl><alt><s>) The exported binary file name is Sketchbook location/sketch name/build/arduino.avr.nano/sketch name.ino.hex. eg.
C:\Users\**user**\Documents\Arduino\_Blinkx\build\arduino.avr.nano\_Blinkx.ino.hex
This file name will replace
C:\Users\**user**\AppData\Local\arduino\sketches\B27BE0BD09045C16054140637AB4EF50/_Blink.ino.hex
in the above captured command. (between"-Uflash:w:
and:i"
)To upload the file, without compiling, paste the modified command into a command line window:
"C:\Users\**user**\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\**user**\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM14" -b115200 -D "-Uflash:w:C:\Users\**user**\Documents\Arduino\_Blinkx\build\arduino.avr.nano/_Blink.ino.hex:i"
I tried to be as generic as possible. Mine is a windows installation. user is replaced with your-user-name. My program was a saved version of Blink. My com port "-PCOM14", was 14. The location of the download program and the configuration file are also installation dependent. That's why I copy it all from the upload output.
OK, I have to compile twice, but only 1 time would I have to compile twice, because subsequent changes I would export-compiled-binary and use the same command.
When a device fails, I put the NODE_ID of the dead device in to the EEPROM as above and load the program.
So, yeah, RTFM. But sometimes the FM is doesn't connect the dots. That's why we have the forum. And, truly, thanks for the comment because I wasn't clear as to why I did it in such a convoluted way.
-
RE: Nb of possible nodes in a mysensors networks with domoticz
here's one of my programs I use to set the node ID in EEPROM:
#define Ver 1.0 #include <EEPROM.h> // ------------------------------------------------------------------------------------clearSerialBuffer void clearSerialBuffer(){ while(Serial.available()){ Serial.read(); delay(50); } } // ------------------------------------------------------------------------------------header void header(){ uint8_t EEpromInt = EEPROM.read(0); Serial.print(F("Current value at address (0) is ")); Serial.println(EEpromInt); clearSerialBuffer(); Serial.print(F("Enter a an unsigned integer >0 and <254: ")); } // ------------------------------------------------------------------------------------setup void setup() { Serial.begin(115200); Serial.print(F("\n\rAddress As uint8_t ver ")); Serial.println(Ver); clearSerialBuffer(); header(); } // ------------------------------------------------------------------------------------loop void loop() { if (Serial.available()){ long inInt = Serial.parseInt(); if (inInt <= 0 || inInt >=254){ Serial.print(F(" I don't like '")); Serial.print(inInt); Serial.println(F("'")); } else { EEPROM.write(0,uint8_t(inInt)); } header(); } }
One would run it once in the Arduino, then load the actual program..
This boiler plate show how to set the variable (and set up for data coming from Home Assistant
#define VER "01" #define PROGRAM_NAME "PROGRAM NAME" // " " is required // compiler directive to select development vs production environment // comment out directive for production environment #define DEVELOPMENT // MySensors Gateway on channel 86 otherwise 121 // Setting Node ID from EEPROM #include <EEPROM.h> unsigned short MY_NODE_ID = EEPROM.read(0); // get NODE ID unsigned short dispMY_NODE_ID = MY_NODE_ID; /* ver 01 Make notes for each version change */ #include <LibPrintf.h> //--------------------------------------------------MySensors parameters #define MY_DEBUG // radio type, radio control pins and channel #define MY_RADIO_RF24 // this matches the nRF24 nano #define MY_RF24_CS_PIN 9 #define MY_RF24_CE_PIN 10 #ifdef DEVELOPMENT #define MY_RF24_CHANNEL 86 #else #define MY_RF24_CHANNEL 121 #endif #define MY_RF24_PA_LEVEL (RF24_PA_MAX) #include <MySensors.h> // these wait periods seem to be necessary #define WAIT_AFTER_SEND_MESSAGE 300,0 // ms to wait after send message #define WAIT_AFTER_PRESENTATION 5000,0 // ms to wait after presentation message or echo was returned // configure communication protocol to Home Assistant for power, energy, voltage, current, VA, and powerfactor #define CHILD_ID_SENSOR_0 0 // Id of the sensor child MyMessage msgPOWER(CHILD_ID_SENSOR_0, V_WATT); // HA can only send text data. If the text sent is a number, Arduino can read it as a number. // The MySensors integration into HA cannot send numbers, but can send text. The Arduino must define a “sensor” as V_TEXT, present it as S_INFO, and as above any value sent as it ends up at HA as text. #define CHILD_ID_receive_from_HA 7 // ID of entity that receives numeric data from HA sent as text MyMessage msgFrom_HA(CHILD_ID_receive_from_HA,V_TEXT); // for receiving number of counts as text //------------------------------------------------------before (starting MySensors) // This will display program information before attempting nRF24 network connection void before(){ // this happens before MySensors starts analogReference(EXTERNAL); // this needs to be done very near the start so ADC doesn't get buggered // usual program information at very start Serial.begin(115200); #ifdef DEVELOPMENT Serial.println("---------------------------------- DEVELOPMENT ----------------------------------"); #endif Serial.print(PROGRAM_NAME);Serial.print(" version ");Serial.println(VER); Serial.print("Channel ");Serial.println(MY_RF24_CHANNEL); Serial.print("Node: ");Serial.println(dispMY_NODE_ID); } //-------------------------------------------------------presentation void presentation(){ sendSketchInfo(PROGRAM_NAME, VER,true); // "true" means send echo request wait(WAIT_AFTER_PRESENTATION); present(CHILD_ID_SENSOR_0,S_POWER,"Sensor_0_name",true); wait(WAIT_AFTER_PRESENTATION); present(CHILD_ID_receive_from_HA,S_INFO,"Data_for_MySensors_sensor",true); wait(WAIT_AFTER_PRESENTATION); } //------------------------------------------------------setup void setup() { // request last known kWh value from gw/HA send(msgPOWER.set(-2147483646),true); // an ENERGY of 1 is ignored, used to sent the energy to no zero wait(WAIT_AFTER_SEND_MESSAGE); wait(WAIT_AFTER_SEND_MESSAGE); send(msgFrom_HA.set(0),true); // Ensures that HA sees the "sensor" wait(WAIT_AFTER_SEND_MESSAGE); wait(WAIT_AFTER_SEND_MESSAGE); } volatile bool MsgReceived = false; volatile long NumberFromHA = 0; //------------------------------------------------------loop void loop() { //------------------------cumulative energy one-time initialization if (MsgReceived){ // message came in from HA MsgReceived = false; // note that this message was processed // Deal with message received from HA } // Other loop stuff } //------------------------------------------------------receive void receive(const MyMessage &message) { if (message.getType()==V_TEXT) { if(message.getSensor() == CHILD_ID_receive_from_HA) { // filters out ACK messages and ensures that the data is what was intended MsgReceived = true; NumberFromHA = message.getLong(); // the reads the text sent and stores as a long integer } } //printf("Received Message --- command: %d Type: %d\r\n",message.getCommand(),message.getPayloadType()); }
I hope this helps
OSD
-
RE: 💬 Components
@GLAB said in
Components:
nrf24l01+
I have run the RF24 libraries in 230kbs and that worked for me. I cannot confirm MySensors, but I would assume "yes"
OSD
-
RE: Nb of possible nodes in a mysensors networks with domoticz
I set all of my node numbers to prevent confusion. I have 4 locations with level sensors (full/notful and empty/notempty) They run identical code. The only way I know which is which is by the node number. Before I load the code into the Arduino, I set the the 0 location of the Arduino EEPROM with the node number. The code reads the EEPROM on boot.
Many of my communication problems are the result of a loose wire. I spent a lot of time running the Getting Started code in the RF24 library by TMRh20 on two Arduinos to ensure that the Arduino is wired correctly and can send and receive data..
I mucked-up my system many times and finally decided to create a second "development" system. I use two different channels for the Arduino/MySensors networks. I like the Arduino/MySensors because they are cost-effective; the downside is the radio.
I started to migrate to ESP devices because of the built-in WiFI. The downside there is that my WiFi network can only handle about 20 WiFi devices. A Unify Lite AP solved this, but now the network costs twice as much as a MySensors network.
Good luck on your project
OSD
-
RE: Gateway without a radio
I forgot to note, that a MySensors network can handle a lot of devices, just how many is up for debate. My Asus router, which I think is typical, can only handle about 25 WiFi connections. This would be a limiter for and extensive ESP network.
-
Gateway without a radio
Unwittingly I have been migrating away from MySensors. Partly because of the dwindling users and partly because I can find cheaper, more robust solutions. For about USD$2.50 one can have an ESP8266 with 80-260VAC power supply. I use both Tasmota and the Arduino IDE for programming.
But, I can't see giving up my RPi Zero 2W gateway because it's running my irrigation system. The irrigation control is Integrated into the gateway as "sensors"
The irrigation is gravity fed. I have 10 levels and five microclimates, which works out to 20+ zones. This would be a challenge to do on an Arduino Nano.
I only have one other sensor left in my radio network and I will eventually replace it. Which leaves me with a gateway with no need for a radio.
I haven't tried it yet, but can the RPi gateway code run without a radio? I ask because the RPi can handle a lot of tasks and the communication with home automation controllers work well. Seems like a good way to go for complex sensors.
(I may try again with my battery powered mosture sensors which would utilize MySensors )
OSD
-
RE: Long time test done with soil sensor!
I am duly impressed! I tried something similar. I knew that the environment into which I was putting the sensors was pretty harsh ... I only got about a year. I used an 82650 battery, 5W solar cell and a charge controller. Worked well for a short while.
I think you inspired me to try again.
OSD
-
RE: LAN8720A - will mysensors work with this module
@Marcin I googled KC868-A12 and came up with only KC868-A128. If this is not your board, please provide a link. Did you mean KC868-A16? AliExpress Note that these are relay driver boards. If you do indeed use relays, you would need a daughter board.
My link states that this can be programmed with the Arduino IDE which implies that the LAN drivers are not going to be a problem.
MySensors REQUIRES a radio. I use nRF24; there are others. It would be tricky, if even possible, to connect a radio to this board because there are only 3 free GPIO pins. Thus, this is not technically a MySensors question.
But you could send and received messages to/from an MQTT broker and have the controller of your choice.
The real question here is the complexity (size) of the program. My recommendation is just try it yourself. I would recommend Tasmota and do your logic in your controller. If you need very fast response times, then consider programming with the Arduino IDE.
Cool project! Let us know how it turns out.
OSD
-
Water Meter or "How to get Home Assistant to send saved data to an Arduino"
This is a pretty basic project except that the trick was to get Home Assistant (HA) to store the cumulative water usage and then send it back after an Arduino (re)boot.
Here is a link to my documentation, such as it is.
And a link to the Arduino code. (the HA side is in the previous document)