Skip to content

Development

Discuss Arduino programming, library tips, share example sketches and post your general programming questions.
1.5k Topics 13.5k Posts

Subcategories


  • 56 578
    56 Topics
    578 Posts
    HJ_SKH
    Hi2All! Surprising is here. After about 24hours I refresh HA and suddenly my motion sensor was integrated. There is also second entity > battery : 0 , have to look deeper into that for understanding. Need to change little in the sketch, because don't want every short time 'no movement' so only when there is motion and maybe once a hour indication sensor is alive. Meantime I found 3 other good threats: https://forum.mysensors.org/topic/11200/finally-progress-evidence-based-radio-testing-method-and-capacitors https://forum.mysensors.org/topic/1664/which-are-the-best-nrf24l01-modules/27 https://forum.mysensors.org/topic/9550/build-a-reliable-power-supply-chain Very usefull for me also finally progress because of lacking time in the past. Great jobs are done here! Thanks for this all of you guys or girls!
  • MYSController with MQTT Gateway (via Node Red)

    1
    1 Votes
    1 Posts
    15 Views
    No one has replied
  • MQTT GW on ESP8266 supporting SSL/TLS?

    mqtt gw esp8266
    6
    0 Votes
    6 Posts
    32 Views
    OldSurferDudeO
    @bgunnarb I like @eiten 's solution for you. Personally, I am not a fan of using cloud/public brokers. Thus I am curious about your system and there is something about it from which I can learn. I would like to understand why you cannot deploy your own mosquitto broker. I see your set up as 3 sensor groups defined by the channel used #define MY_RF24_CHANNEL ChannelOfSensorGroup Each sensor group has some number of sensors and one MQTT GW on ESP8266. On the MQTT side, do you distinguish between gateways by using a different host name? Something like: #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway-nOf3-out" #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway-nOf3-in" #define MY_MQTT_CLIENT_ID "mysensors-nOf3" #define MY_HOSTNAME "ESP8266_MQTT_GW_nOf3" //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68 #define MY_CONTROLLER_URL_ADDRESS "test.mosquitto.org" #define MY_PORT 1883 I must assume your controller (aka Home Assistant) discriminates between through which gateway the data is to flow by way of the different topic names. If my "something like" is correct, then changing brokers is changing the IPaddress/URL in your gateways and in your controller (though if the controller is Home Assistant, it may be a bother because the device-id's may change which will make a mess of all the work you've done in HA. This is why I like @eiten 's solution.) I hope it's all working for you again. OSD
  • Gateways

    nano serial gateway tcp gateway mqtt gateway raspberry pi rpi esp8266
    2
    0 Votes
    2 Posts
    36 Views
    E
    @OldSurferDude well, the ESP8266 is limited to 4 TCP clients in arduino IDE. This can't be really increased. I did som experiments and you can set it up to 15, but after the 5th client on my web server, I got a freeze. Maybe you got something wrong. #define MY_GATEWAY_MAX_CLIENTS 2 defines how many controllers (eg Home Assistant) can connect to the gateway, not how many sensors/MySensors devices. And yes, you can have multiple TCP gateways in HomeAssistant. I got an NRF24, an RFM95 long range and a RFM95 short range gateway (all based on ESP32) on the same Home Assistant. Regards, Edi
  • Serial Gateway woes

    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • 0 Votes
    1 Posts
    12 Views
    No one has replied
  • Sensebender Gateway (SAMD21)

    10
    0 Votes
    10 Posts
    63 Views
    P
    Just for completeness: the right way to do this is to add the json under ~/.platformio/boards and the other files as described in https://community.platformio.org/t/how-use-a-same-chip-but-with-different-environment/18082/4
  • FOTA using OptiBoot copy_flash_pages

    2
    2
    0 Votes
    2 Posts
    32 Views
    E
    IT WORKS I got a first working version, using an ATmega1284P running on MightyCore 2.2.2 (as soon as I began developement, they switched from Optiboot to Urboot in version 3.0.0, whicht does not include the copy_flash_pages function anymore, but I'm working on a work around there). Only thing I could not solve is to do a CRC check of the image after download... You can try it out here: https://github.com/eiten/MySensors/tree/FOTAInternalFlashTest It's not beautiful yet with much Serial.prints in it, but maybe it helps you if you find errors.
  • How control W5500/W5100 (with STM32) by mysensors library

    2
    0 Votes
    2 Posts
    19 Views
    MarcinM
    I found procedure gatewayTransportInit(), it works great. However, I cannot find a procedure that will enable detection of a network connection at level mysensors. I noticed that disconnecting the network plug or resetting the W5500 (37 pin to ground) changes the device's IP address to 0.0.0.0 - then I call gatewayTransportInit() - but mysensor's library must have such procedures - please tell me how to diagnose ethernet connection.
  • problem with Dallas temperature

    3
    1
    0 Votes
    3 Posts
    26 Views
    M
    hello, I just deleted the eeprom but I still have the problem. [image: 1698703321335-capture.png]
  • ESP32, MySensors and function

    2
    0 Votes
    2 Posts
    43 Views
    electrikE
    You should only include the relevant header file in the file Gestion_Porte.hpp, not Mysensors.h For example #include <core/MyTransport.h>
  • MYSBootloader + STM32 with Ethernet module

    2
    0 Votes
    2 Posts
    17 Views
    E
    I'm afraid, the MYSbootloader is only available for the AVRs.
  • MYSBootloader

    2
    0 Votes
    2 Posts
    21 Views
    karlheinz2000K
    No. For RFM69 you need Sensbender bootloader and external flash. Then it works.
  • NRF24L01+PA+LNA power down question

    8
    0 Votes
    8 Posts
    617 Views
    Patrice GALMOTP
    @Dan-Mincu Hello I am looking for help because I have the same problem. Can you show me the code you use to set power down radio?
  • MySensors Gateway on OrangePi 5

    5
    0 Votes
    5 Posts
    41 Views
    M
    Thx for the hint. Unfortunately this didn't help me to find a solution for the compilation error. I simply don't understand the lines 105 and 106 in (MyHwLinuxGeneric.h). Can anyone explain me the C magic going on there? #define ATOMIC_BLOCK for ( ATOMIC_BLOCK_CLEANUP, __hwLock(); \ __atomic_loop ; __atomic_loop = 0 ) I think the problem is the "new"/different compiler version being used on the OrangePi 5. On my Raspberry Pi the code compiled without any problem.
  • Jenkin erros I do not understand

    1
    1 Votes
    1 Posts
    18 Views
    No one has replied
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • 0 Votes
    5 Posts
    29 Views
    TheoLT
    Depending what's connected to a relay, I wouldn't make it go on or off depending on the controller state. It can lead to dangerous behaviour and it's prohibited by law in my country. In all honesty I have my Sensors running for a long long time. It's stable and more reliable than anything else I have running in my home. But like @eiten says yo could write a sketch that queries for a variable. But I think I'd go for a controller side solution. That would "ping" my node and send a nottfication to my phone whenever the node can't be reached.
  • Send message to all nodes

    5
    0 Votes
    5 Posts
    35 Views
    J
    I searched on the forum how to use ID255 but found nothing practical https://forum.mysensors.org/topic/8941/mysensors-get-temperature-value-from-another-node-through-the-gateway?_=1684325843882&lang=fr https://github.com/mysensors/MySensors/blob/development/examples/PingPongSensor/PingPongSensor.ino
  • Use of BH1750 light sensor in low power node

    16
    1 Votes
    16 Posts
    7k Views
    N
    @gerritv Thank you for pointing the problem. I was updating my code, while library was updated and found that i had funtion, that does not exists in library - i've added it in local copy in library, then it updated and my local patch was gone. I've investigated previosly mentioned PR - and must admit that later they removed that re-initialisation when reading. I will try a PR to slightly improve that behaviour, but looks like library is becoming abandoned. Now look it should work next way: after previous measurement done you must run lightSensor.configure(ONE_TIME_) so it starts measuring - this is shown in their example BH1750onetime.ino. Then we have to wait, but measurementReady() relies on _delay_ms, which (as i remember) won't tick during sleep so you can't sleep. We can sleep but we can't get exact measurement time for current settings. Soto save battery we sleep max time - which, according to library is 180ms. Then we get reading. On next cycle - repeat. As i understand maximum battery saving code will look like: void setup() { Wire.begin(); // Initialize the I2C bus (BH1750 library doesn't do this automatically) lux_init_status = lightMeter.begin(BH1750::ONE_TIME_LOW_RES_MODE); //init ONE_TIME - at same time it will start measuring, but we will ignore this and double-call start measuring if (lux_init_status == false) { send(deb_msg.set("ErrorInitLux")); //notify us about failure } } void loop() { if (lux_init_status) { //making it fail-safe - if BH1750 brokes then other sensors will still work lightMeter.configure(BH1750::ONE_TIME_LOW_RES_MODE); //this will start measuring, after it sensor will go into power-down mode //note, that configure has 10ms sleep built-in sleep(180); //this is guarantee time in this library with any config. We can't get that externally as for v1.3.0 long lux = lightMeter.readLightLevel(); //actually get results } sleep(SLEEP_TIME);//sleep between measurements } note that .configure() that is also called by .begin has built-in 10ms delay
  • HowTo MY_CORE_ONLY

    3
    0 Votes
    3 Posts
    28 Views
    F
    That's the point, i don't see important part which change with or without my_core_only. I think i miss something

19

Online

11.7k

Users

11.2k

Topics

113.0k

Posts