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!
  • Use of BH1750 light sensor in low power node

    16
    1 Votes
    16 Posts
    8k 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
    147 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
  • can't get aht10 working sidebyside mysensors

    5
    0 Votes
    5 Posts
    269 Views
    bachB
    i had my answer on ahtxx issue Hi, ...figured out that the _address is messed up (i guess by mysensors). It is impossible, because _address is private variable. The private data members cannot be accessed from outside the class (mysensors can not see it). Сan you try my original library but with class initialization line AHTxx aht10(0x38, AHT1x_SENSOR); //sensor address, sensor type
  • Buttler/Jenkins error I don't understand

    1
    0 Votes
    1 Posts
    74 Views
    No one has replied
  • Please I need some help

    15
    0 Votes
    15 Posts
    542 Views
    Emmanuel AbrahamE
    @gulshan212 how can i do this by using mysensors library coz i need also to save battery power.
  • 433 mhz from Arduino to Raspberry

    3
    1
    0 Votes
    3 Posts
    170 Views
    electrikE
    I would recommend to switch to a nrf24l01 or rfm69/95, where you will have bidirectional communication and you can use the mysensors framework
  • Compilation failure

    3
    0 Votes
    3 Posts
    230 Views
    M
    Wow - given the age of the most recent messages on here, I wondered if I would get a response. Many thanks for responding so quickly and my problem is resolved. [ Note I now also have PlatformIO installed and that compiled the sketch at the first attempt. I can't work out which version of the board it is using, as it uses different naming conventions, but I think it is the most recent. ]
  • PlatformIO, nRF52832 and MyBoardNRF5

    10
    0 Votes
    10 Posts
    401 Views
    S
    @electrik upload_port does not specify the target. It just selects if you'll use the gdb port or the uart port from the BMP. The target I'm talking about is what comes up when trying to do upload. Configuring upload protocol... AVAILABLE: blackmagic, cmsis-dap, jlink, nrfjprog, nrfutil, stlink CURRENT: upload_protocol = blackmagic Looking for BlackMagic port... Auto-detected: COM2 Uploading .pio\build\MyBoardNRF5\firmware.hex Target voltage: 3.45V Available Targets: No. Att Driver 1 Nordic nRF52 M3/M4 2 Nordic nRF52 Access Port 0x000020d8 in transportProcessFIFO() () Loading section .text, size 0x895c lma 0x0 Loading section .ARM.exidx, size 0x8 lma 0x895c Loading section .data, size 0x23c lma 0x8964 Start address 0x32e0, load size 35744 Transfer rate: 42 KB/sec, 916 bytes/write. Section .text, range 0x0 -- 0x895c: matched. Section .ARM.exidx, range 0x895c -- 0x8964: matched. Section .data, range 0x8964 -- 0x8ba0: matched. Kill the program being debugged? (y or n) [answered Y; input not from terminal] If I don't do #define MYBOARDNRF5 then PlatformIO complains about undefined reference to 'g_ADigitalPinMap', which is in compat_pin_mapping.h and is called from MyBoardNRF5.cpp when MYBOARDNRF5 is defined. But I see that your variant.h/.cpp is different than the ones coming with ArduinoHwNRF5, which I'm using. Maybe try your version instead and see what happens...
  • Node to node communication fails if gateway is not reachable

    30
    0 Votes
    30 Posts
    6k Views
    J
    the Node To Node must be seen as a Gateway to node :) the controller is not mandatory. so we rethink the topology. Gateway (node0) <---> Node1 <---> Node2 <---> 3.. 4... The Gateway in 2022/2023 must be used, how to do!!?!! ...... a Node Useful :) (yes an old message, but to refresh the ideas ) happy holidays to you all
  • GatewayESP32MQTT with local sensor crashes

    11
    0 Votes
    11 Posts
    369 Views
    mfalkviddM
    @Stig I wouldn't bet on anything soon.
  • Help, version 2.4-alpha, PI-4 64bits & Mac OS

    2.4 pi 4 64bits macos
    2
    0 Votes
    2 Posts
    126 Views
    electrikE
    @briseis I would just switch back to 2.3.2 I also believe 2.4 on the gateway should work with nodes on 2.3.2. what kind of errors did you get when doing this?
  • MQTT GW - QOS

    7
    0 Votes
    7 Posts
    2k Views
    M
    Hi @Soloam, not sure if you managed to solve your problem. I would recommend using Mosquitto MQTT broker open source or Pro version since they both support all MQTT QoS levels (including QoS 0, QoS 1, QoS 2).
  • CAN bus transport implementation

    54
    3 Votes
    54 Posts
    2k Views
    J
    Hello CAN Bus is still functional, and no problem. a question : is it possible to implement the use of 2 CAN Module on the same Gateway. 2 CAN bus or RS485 + CAN as for the RS485 in example for a Mega2560 board MyConfig.h ...... * Example: @code #define MY_RS485_HWSERIAL Serial1 @endcode */ //#define MY_RS485_HWSERIAL (Serial1)
  • GUIDE - NRF5 / NRF51 / NRF52 for beginners

    102
    10 Votes
    102 Posts
    23k Views
    NeverDieN
    @ncollins Impressive! Looks as though you even modeled the exact shape of the coincell holder. And you apparently designed the 3D printer snap enclosures as well. Even just the 3D printed enclosure modelling is quite a task all by itself. I hope to one day evolve into doing that too, but for now the Hammond enclosures are going to be my short-term solution. The smallest Hammond is still not as small as what you've managed to produce, but at 36mm wide for an off-the-shelf ABS enclosure, it's too wide by only about 10mm. Still.... one day I want to 3D print an enclosure to be as small as possible.
  • Low power sketch burns batteries

    1
    0 Votes
    1 Posts
    66 Views
    No one has replied
  • MySensors gateway running as a service

    gateway
    4
    0 Votes
    4 Posts
    214 Views
    OldSurferDudeO
    @mfalkvidd Thanks, I didn't see that! OSD
  • Array in send message command

    3
    0 Votes
    3 Posts
    140 Views
    Y
    Great, thanks for your reply and help. I was able to do what I wanted, I give you some code snippets to make several messages via a for loop, I'm not a code proffesional but this works: // Initialize messages MyMessage msgInA(0,V_CURRENT); MyMessage msgWhA(0,V_WATT); #define NSENSORS 6 //used current sensors void setup() { //initialize energy monitor CurrentSensor for (int i=0; i<NSENSORS; i++) { wh[i] = { 0.0 }; //initialize wh lwhtime[i] = {0}; //initialize time present(i, S_MULTIMETER); } for (int i=0; i<NSENSORS; i++) { present(i, S_POWER); } } void loop() { for (int i=0; i<NSENSORS; i++) { send(msgInA.setSensor(i).set(Irms[i], 1)); send(msgWhA.setSensor(i).set(wh[i], 1)); } } Thanks
  • Wait() in setup question.

    4
    0 Votes
    4 Posts
    250 Views
    J
    maybe this can be useful : https://forum.mysensors.org/topic/6948/synchronising-light-switch I use it with version 1requestState or 2 requestTime() on some sketches (I modified the structure, moved some parts to functions to make it more readable )
  • Browser-based firmware generator

    108
    8 Votes
    108 Posts
    32k Views
    rakeshpaiR
    @alowhum Sorry, I have abandoned this project. It didn't garner the interest I hoped it would, and I’ve moved on to other microcontrollers/radios/networks since then. This is hosted on GitHub’s free static hosting, so it should continue to work as long as they are in business, and it should work on devices as it was 5-6 years ago. But I won’t be supporting it and won’t continue to build on it. Glad to hear that you like it!
  • ESP WiFi hung solution

    1
    2 Votes
    1 Posts
    211 Views
    No one has replied

17

Online

11.8k

Users

11.2k

Topics

113.2k

Posts