@OldSurferDude the max number of nodes is 253, as with any MySensors gateway.
The esp-12f has a lot more resources than an atmega328.
@OldSurferDude the max number of nodes is 253, as with any MySensors gateway.
The esp-12f has a lot more resources than an atmega328.
Thers is actually support for pjon as transport in MySensors: https://github.com/mysensors/MySensors/pull/1278
I don’t know how it works though.
@fsgraz you might want to use the tcp option for the ethernet gateway then. See https://www.mysensors.org/about/overview and https://www.mysensors.org/build/select_gateway
@tnick STM32F1 2019.12.8 (stm32duino) is the version that was active when the latest MySensors release was made. Later versions may or may not work; nobody would know until they tried.
@tnick which version of MySensors are you using?
Are you using the correct board definitions? STM32F1 2019.12.8 (stm32duino)
https://github.com/mysensors/MySensors/pull/1562 switches to using libgpiod instead of the earlier interface. I have not tested it myself but it looks good.
@JanJaap-Jagtenberg according to https://www.reddit.com/r/tradfri/s/gvFcOmHe8h the ”best” solution is to replace the led driver (but keep the lights).
An alternative might be to buy a used remote on ebay or a local equivalent.
Do you know what is wrong with your current remote? Maybe it can be fixed?
@FcNanoLed sensor IDs must be 0-254. For example, ID 635 will be transmitted as 123 (635 modulo 256).
Change all IDs to be between 0 and 254.
@dpcons you can have as many nrf24l01 MySensors networks as you like.
They are differentiated by channel and base radio id.
The reason for multiple networks may be more control, isolation, lab/test/production network, approaching the limit (255) of the number of nodes in a single network, separate network for high-traffic devices, different versions of MySensors, interference, range problems, and more.
@dpcons there can only be one MySensors gateway in a MySensors network.
You can have as many MySensors networks as you like.
A MySensors network can exist of only a gateway (no other MySensors nodes required)
If that's not the case, is there a point to having one, if I already have an esp8266 WIFI gateway with a nRF24L01.
There can be points. I don’t know your needs.
If a radio is required on the MQTT, does that mean another nRF24L01 can be connected to the system? Is that possible?
No radio is required on the mqtt gateway.
A mqtt gateway can have a nrf2l01.
I guess what you're saying is that you only need one 2.4G network, be it wifi, mqtt or serial. True?
Could you elaborate on what you mean by ”one 2.4G network”? Do you mean one MySensors nrf24l01 network? Or one 2.4GHz wifi network? Or something else?
@dpcons sensor nodes can not post a mqtt message. Sensor nodes can’t even be aware that they talk to a mqtt gateway: the nodes don’t know if the gateway is wifi, mqtt, serial or any other type.
With that said, sensor nodes can send any message to a gateway, and the gateway will forward the message on mqtt (if it is a mqtt gateway). Simplest example is probably something like https://github.com/mysensors/MySensors/blob/development/examples/BatteryPoweredSensor/BatteryPoweredSensor.ino or https://github.com/mysensors/MySensors/blob/development/examples/BinarySwitchSleepSensor/BinarySwitchSleepSensor.ino
@dpcons try changing unsigned long
in your sketch to uint32_t
Could be that the override needs to have an exact match.
I think the relevant code is here:
https://github.com/mysensors/MySensors/blob/e298769eb73ba2da781a34d66cae345c6840b7c0/core/MySensorsCore.cpp#L473
but I can’t see anything that looks broken.
@dpcons it could be that the gateway code for receiving time is (unintentionally) broken. I noticed that the other thread you found also was about a gateway.
I have never used receivetime myself but I am pretty sure I have seen it working for other people on regular nodes.
The received message looks like this:
Received Message
Sender: 0
Last Node: 0
Destination: 6
Sensor Id: 255
Command: INTERNAL
Message Type: I_TIME
Payload Type: P_STRING
Payload Length: 10
Signing: 0
Payload: 1740594416
1740594416 is Thu, 27 Feb 2025 11:56:37 GMT which looks reasonable.
So question is, why doesn’t the node print the received time?
@OldSurferDude yes, just run the configure command with --my-transport=none
Nice, @Nicklas-Starkel !
Good to ser you again btw
@Trand yes, use the indication handler. https://forum.mysensors.org/post/103904 should be a good start.
That’s impressive @NielBierman, great work! Would you mind sharing what nodes you have, as inspiration for us who haven’t leveled up as far yet?
@diltech yes it should work. But it depends a bit on which installation method you used for HA.
There are 4:
Home Assistant Operating System
Home Assistant Container
Home Assistant Core
Home Assistant Supervised
@TheoL there are two pull requests adding support for newer versions.
One is guaranteed to break again.
One should not break in the future, but will instead break all existing sketches.
I’m sure a third option would be welcome if you write the code and submit.
@TheoL the latest supported version is ESP8266 2.6.2
Reference: https://github.com/mysensors/MySensors/releases/tag/2.3.2
Nice work so far @wint0178, great that you try expanding on the examples. Sorry for the late reply.
If you look at https://github.com/mysensors/MySensorsArduinoExamples/blob/bba998bce09bc5139eb4ca7a05b0279f4083ff88/examples/PressureSensor/PressureSensor.ino#L90 you see where the existing child ids are defines. You just add another one for the gas sensor, with a unique number (incrementing by 1 is an easy way).
Try that and report back on your result. If something is unclear, just post a followup.
@ben999 just remove the stropts include (in hal/architecture/Linux/drivers/core/interrupt.cpp), or use the development branch where the include has already been removed.
@Tmaster could you share the entire sketch? That usually makes it easier to spot problems.
Welcome to the forum @mauri
Did you follow the instructions at https://www.mysensors.org/build/orange ?
Sorry, I don't have any insights for the rssi issue.
@dbemowsk yes there is. Sorry for the inconvenience.
I don’t know what is wrong, but search does not work anymore.
@Oumuamua nice work on troubleshooting.
The clear difference I see is that you request echo of the rssi message, but not for temp and hum.
Could you try turning off the echo request and see if the NACK goes away? The behavior might give a clue to what the problem is.
@monte agreed. That’s why I think there is only one viable solution.
@monte yes, could be. I prefer control myself, which is why I have never used NodeManager (which was created because MySensors was seen as exposing too much of the underlying stuff).
From what I understood, much of the early success for MySensors came from being easy to use, but that was long before I became aware of MySensors existance.
A big rewrite of MySensors might be a solution. The challenge would be for interested people to gather enough people, and plan and implement that rewrite together. Recent interest levels suggest that such an effort would be unlikely.
@d-smes yes, almost every upgrade of the esp core breaks compatibility with MySensors. The symptoms are wildly different for different esp versions. Some versions give different compilation errors or warnings, some versions compile fine but fail when the esp boots. This makes it very hard for anyone to realize what problem they are having, and also makes it hard to search the forum for "similar" problems.
There are two pull requests attempting to fix this:
https://github.com/mysensors/MySensors/pull/1513
https://github.com/mysensors/MySensors/pull/1524
The one by virtual-maker makes changes that make it possible to use existing sketches, but this fix is likely to break again, just like it has done multiple times before.
The one from d-a-v (who is a big contributor to the esp8266 Arduino core) should be a more permanent solution, but will require changes to all user sketches. (See here for more details by virtual-maker)
The contents of the pull requests and the different interactions between MySensors and the esp8266 core are way too complex for me to comprehend so I can't explain why this is such a big problem. But my gut feeling is that none of the solutions are desirable, but the current situation is not desirable either.
The only viable solution so far seems to be to reiterate the recommendation to use ESP8266 core version 2.6.2 which is listed in the release notes [1] [2] but as you've discovered yourself this is not very effective because nobody reads/remembers it.
An alternative could be to remove support for esp in the next MySensors release. Doing so would stop people from spending time scratching their head trying to figure out what is wrong, but I doubt that would make people very happy either.
Welcome to the forum @isded
MySensors supports the hoperf rfm9x (95/96/97/98) lora radios.
Welcome to the forum @mtedds
If you haven't already, downgrade the esp8266 board definitions to 2.6.2. See also https://forum.mysensors.org/post/113281
https://www.bosch-sensortec.com/products/environmental-sensors/particulate-matter-sensor/bmv080/ could be the next generation. No moving parts. Measures PM2.5. Datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/product_flyer/bst-bmv080-fl000.pdf
@OldSurferDude use a host name for the broker in the configure command (--my-controller-url-address=
). Add the host name to /etc/hosts
on the rpi where the gateway is. Start the MySensors gatway.
When you want to switch brokers, modify /etc/hosts again and restart the MySensors gateway.
Keeping up with the (slightly broken) tradition from earlier years (2016, 2017 and 2018) :
Metric | 2016 | 2017 | 2018 | 2023 |
---|---|---|---|---|
supported controllers | 18 | 26 | 26 | 26 |
registered forum users | 2200 | 4700 | 6800 | 10800 |
unique visitors/month on mysensors.org | 45000 | 74000 | 72000 | |
code commits | 1215 | 1711 | 1858 | 2109 |
forks on github | 368 | 544 | 675 | 891 |
stars on github | 726 | 1246 | ||
open source hardware projects added on openhardware.io | 129 | 272 | 521 |
And as a bonus, a statistic on the number of spam users: Between 2021-11-12 and 2023-01-03 (so roughly the last year), we added a total of 946 users to the forum. In the same time, I banned 207 users for spam.
Welcome to the forum @StefanH
I took the liberty to edit your post to mark your sketch as code. This makes the code mich easier to read. You can use the </> button on top of the edit area next time.
Have you looked at https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino ? It has support for multiple sensors.
In any case, please post the debug output of your sketch. It will make it 10-100x easier to troubleshoot. If you haven't already, see https://forum.mysensors.org/topic/666/read-this-first-it-could-save-you-a-lot-of-time/ for how to enable debug output.
@Stig I wouldn't bet on anything soon.
Thanks for explaining @Stig
I guess it would be possible to use https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/core/MyMessage.cpp#L279 to get a string representation of the message and print it. Or would a hexadecimal representation make more sense? None of them would match the binary message posted to the mqtt topic though, unless your mqtt client does some conversion (to hexadecimal most likely).
Edit: there is a 2 year old pr for adding binary support to mqtt explorer: https://github.com/thomasnordquist/MQTT-Explorer/pull/493
If merged, mqtt explorer would support hex so maybe we should use hex as well?
Nice work @Stig, thanks for reporting back.
Yes, using send is correct. The log looks good to me. Were you expecting something different?
@Stig isn’t is necessary to call bme.begin() before using the sensor?
Their example does: https://github.com/adafruit/Adafruit_BME280_Library/blob/master/examples/advancedsettings/advancedsettings.ino#L41
Welcome to the forum @Dave2526
Yes. The return value of the sleep call will let you know the reason for waking up. Documentation: https://www.mysensors.org/download/sensor_api_20#sleeping
Nice work @Keichi, thanks for reporting back!
@Keichi sorry, I thought you were using an esp bpard.
Have you tried different baudrates in the serial monitor? If you are able to find one that works, you might get useful information.
Welcome to the forum @Keichi
Maybe https://forum.mysensors.org/post/113281 can be useful?
Welcome to the forum @Gibber
Unfortunately, esp32 usage is not that common in MySensors so you might be the first person to try the S2 with this combination of version.
One thing that could be worth trying is to downgrade thr esp32 library to 1.0.4 which was the active version when MySensors 2.3.2 was released. Similar downgrades have been necessary for esp8266 lately.
Nice work @Igor-Vinograd, thanks for reporting back.
Welcome to the forum @Igor-Vinograd
If you haven’t already, see https://forum.mysensors.org/post/113281
My guess is that you are experiencing the same problem.
@electrik version 3 will not work. 2.6.2 is required.
@Bramz see section #1:1 in https://forum.mysensors.org/topic/666/read-this-first-it-could-save-you-a-lot-of-time on how to enable debug logging. After that, please post the serial output here.
@DeepCore not wrong frequency no. But it looks like the feather doesn’t come with the antenna pre-soldered. Since the devices should be identical otherwise, the antenna could be what differs. But if it was, the rssi would probably have been different as well.
Hmm, interesting. On my mobile I get redirected to https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads which works. But on my PC I get an error.
@OldSurferDude that's strange. The driver download link works for me:
But if you can flash the esp, you already have working drivers so there is no need to install more.
We have a lots of users using esp8266 as gateways (I have on such gateway myself) so generally MySensors works well with esp8266. I wonder what the difference could be for your and Bramz's devices.
The esp8266 uses 74880 baud when it boots (before it loads the sketch) so yes, to see the boot output you must use 74880 baud.
@Bramz is anything connected to any of the gpio pins? Some of the pins control boot behavior.
I think that HA would keep the entities and ids if it was aware that the new gateway was a replacement of the old gateway.
@DeepCore do you remember if both modules got similar rssi when you tested the Adafruit rx/tx sketch?
@Emmanuel-Abraham https://www.mysensors.org/apidocs/Node2Node_8ino_source.html shows how to send from one node to another node.
https://forum.mysensors.org/topic/8716/direct-pairing-of-two-nodes-implementation/ might be useful as well.
@ejlane I don't think setting node id helps if Home Assistant think there is a new gateway. A new gateway means a new MySensors network (parallel to the earlier network). Since people could have any number of MySensors gateways connected at the same time, a MySensors node is identified not only by its node id, but by its gateway (address/path) and its node id.
In Domoticz, the correct way is to replace the old gateway with the new gateway, instead of adding the new gateway. I don't know if HA has a similar concept but it should.
@OldSurferDude the HA app is local, no cloud involved. (With the exception of app notifications which go through firebase)
@OldSurferDude great questions. I'm afraid I have no idea. I have never used MySensors with HA.
@OldSurferDude I have not tried it myself, but I think you request it, like https://www.mysensors.org/build/pulse_power does in setup().
You could request it periodically to remove the need for an input button.
@NeverDie I found this at https://batteryuniversity.com/article/bu-902-how-to-measure-internal-resistance
Resistance does not reveal the state-of-health of a battery and often stays flat with use and aging.
Li-ion in an 18650 cell produces about 36mOhm with a 1,000Hz AC signal and roughly 110mOhm with a DC load. Since both readings are valid, yet far apart, the user must consider the application. The pulse DC load method provides valuable readings for a DC application such as a heating element or an incandescent light, while the 1,000Hz method better reflects the performance requirements of a digital load, such as portable computing and mobile phones that rely to a large extent on the capacitive characteristics of a battery.
If the values in the article are representative, it seems like your charger uses the 1,000Hz method. But I am not sure if the value is useful to esitmate ageing.
@NeverDie what do you do when measuring the internal resistance?
(What load, how long do you wait before measuring, etc) ?
Maybe a tipping bucket would work?
@NeverDie yes google maps can be cached offline. I do that. Saves data traffic when I am online as well.
Not sure if the youtuber already mentioned it (I did not watch the videos) but the app called maps.me is great. I use it for offline maps on my phone and tablet. The maps are very detailed and it supports offline routing.
@NeverDie for lorawan, Helium's 400k gateways (they call them hotspots though) might give better coverage, depending on where in the world you want the coverage. https://explorer.helium.com/iot
@NeverDie they already attacked Viasat https://techcrunch.com/2022/05/10/russia-viasat-cyberattack/
But that was not a physical attack.
I wonder how many of the 2,500 satellites need to be affected before the network would be degraded. Physical attacks on a single geostationary satellite is definitely within the capabilities of nation states. But bringing down a constellation is a different game.
Nice work.
I think the cleareeprom sketch works for esp8266 as well. But I don't think old eeprom is the problem.
I don't have much experience with rfm radios so I don't know what could be wrong. Normal things to check is power supply to the radios and antennas for the radios. I think all the rssi lines in the log indicate that there is a lot of radio noise.
@NeverDie today I re-read the fcc rules and I may have mislead you back in https://forum.mysensors.org/post/111853
It seems like the fcc rules say that if you use more than 500kHz bandwidth, you don't need to use frequency hopping, and there is no dwell time requirement.
(2) Systems using digital modulation techniques may operate in the 902-928 MHz, 2400-2483.5 MHz, and 5725-5850 MHz bands. The minimum 6 dB bandwidth shall be at least 500 kHz.
I don't understand why fcc encourages applications to hog a big portion of the spectrum but it looks like you can go willy-nilly if you just use enough bandwidth.
@NeverDie yes, starlink is the obvious, reliable, high capacity (and due to it bein available off the shelf, slightly boring) solution. Their RV plan can be paused and you don't pay any fees when it is paused.
Yet another strategy is to provide offline resources (though a local wifi hotspot). Example: https://www.kiwix.org/en/
I have offline copies of wikipedia, wikivoyage and some TED talks
And is a mesh network isn't exciting enough, there's always the satellite route
https://amsat-dl.org/en/qo-100-high-speed-multi-media-beacon/ (2-way comms if you have a ham license)
https://othernet.is/products/dreamcatcher-circuit-board / https://www.engineeringforchange.org/solutions/product/outernet-lantern/ (note the name change from outernet to othernet )
I find emergency networks interesting, but have not tried any of them. Some other similar projects:
https://github.com/Call-for-Code/ClusterDuck-Protocol
https://github.com/markqvist/reticulum
https://disaster.radio/ / https://github.com/sudomesh/disaster-radio
@Tico what does the gateway log say?
The gteway log will show if the message did not reach the gateway, or the acknowledgement did not reach the node.
@OldSurferDude yes I have read it already. But unfortunately my impression is that my knowledge of how the code works is woefully insufficient.
@qqlapraline I’m far from an expert, but it looks good to me. Clean and simple, not much that should be able to go wrong
Maybe the distance between the capacitor and the radio is a bit long (depending on how wide the traces are I guess).
Maybe try to temporarily add another capacitor close to vcc and gnd on the radio, and see if it helps?
@qqlapraline strange. Seems like you have covered all the usual stuff that might go wrong.
@qqlapraline is the gateway able to communicate with other nodes?
Nice work on the internet connectivity @Kurtsejr
It is an issue on some (newer?) linux versions. It has been fixed in the development version of MySensors. You can switch to the development version, or add the fix yourself.
See https://github.com/mysensors/MySensors/issues/1431 and https://github.com/mysensors/MySensors/pull/1446/files
Sorry for the inconvenience.
@Kurtsejr said in MySensors GW on rpi3:
How do I remove if more that one instance is started? - I will try to google it. Perhaps it's easier to start from beginning again
sudo systemctl stop mysgw.service
will stop the gateway service if it is currently running. It will start automatically again after reboot (unless disabled).
sudo systemctl disable mysgw.service
will disable autostart, but will keep the service running if it has already been started.
https://www.linuxtrainingacademy.com/systemd-cheat-sheet/ can be a good place to start
@Kurtsejr said in MySensors GW on rpi3:
Has something changed? or is it github that does not response?
The Raspberry Pi probably doesn't have the right settings for connecting to Internet. What happens if you run ping google.com
for example? You should get something like this:
ping google.com
PING google.com (142.250.179.142) 56(84) bytes of data.
64 bytes from ams17s10-in-f14.1e100.net (142.250.179.142): icmp_seq=1 ttl=58 time=33.3 ms
64 bytes from ams17s10-in-f14.1e100.net (142.250.179.142): icmp_seq=2 ttl=58 time=33.4 ms
If you don't get any replies, the raspberry pi doesn't have a working internet connection.
@Kurtsejr I tested the gateway on a spare raspberry pi and it does indeed print lots of ERROR accept: Bad file descriptor
when more than one instance of the gateway is started. The solution is easy: don't start two instances at the same time.
The reason is actually printed in the log: ERROR bind: Address already in use
but is easy to miss due to the many ERROR accept: Bad file descriptor
INFO Starting gateway...
INFO Protocol version - 2.4.0-alpha
DEBUG MCO:BGN:INIT GW,CP=R-NGL---,FQ=NA,REL=0,VER=2.4.0-alpha
ERROR bind: Address already in use
ERROR Failed to bind!
DEBUG MCO:BGN:STP
DEBUG MCO:REG:NOT NEEDED
DEBUG MCO:BGN:INIT OK,TSP=NA
ERROR accept: Bad file descriptor
ERROR accept: Bad file descriptor
ERROR accept: Bad file descriptor
ERROR accept: Bad file descriptor
To check if the gateway has started automatically, run sudo systemctl enable mysgw.service
@Kurtsejr yes the gateway will start automatically at each boot, unless automatic start is disabled.
@Kurtsejr did you reboot befor running sudo ./bin/mysgw
?
If that’s the case my guess is that the gateway was already started automatically at boot. When you tried to start another instance, the tcp port was already in use.
@Kurtsejr what configure command did you use?
Were there any warnings or errors during make?
What image are you using?
@mariusl I am not sure I understand the question, but saveState will add EEPROM_LOCAL_CONFIG_ADDRESS to the position you use in the call.
In addition to saveState, there are also low-level functions to read/write larger blocks: https://github.com/mysensors/MySensors/blob/253109d3ff00ec524c5d1e1dfcd8e197c96e54c2/hal/architecture/MyHwHAL.h#L66
But if you use the low level functions, you'll need to calculate position yourself. You can use EEPROM_LOCAL_CONFIG_ADDRESS as start address.