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!
  • [security] Migrating from library version 2.1 to 2.2

    Pinned
    48
    5 Votes
    48 Posts
    9k Views
    AnticimexA
    @alexsh1 re-personalize the node that lost the checksum. Each node (including gw) has a unique personalization and checksum (possibly). Just because one node looses the checksum or gets a mismatch does not mean any other node has the same problem. Everything is stored in eeprom locally.
  • MYSBootloader 1.3.0-beta.3

    Pinned
    182
    4 Votes
    182 Posts
    59k Views
    E
    @Trand Well, sorry, but nothing else comes to mind. If you have a scope or logic analyzer then you need to watch the actual signals on the wires and see what is happening. If you don't, then you should pick up a cheap logic analyzer. You can get one for $10 and it's invaluable for tracking down things like this. I don't know where you are based, but I see them on Aliexpress all the time.
  • MYSBootloader 1.3pre2 testing

    Pinned ota myscontroller mysbootloader
    73
    7 Votes
    73 Posts
    31k Views
    tekkaT
    @karlheinz2000 said: But if I'm not using MYSB, I can flash a sketch with defined ID and this will work instantly in the network. Yes With MYSB I always have to do assign a new ID just to get the node to run the first time after flashing. Only true if EEPROM (i.e. ID address location) was cleared. Any chance to get MYSB to know, if a sketch is an flash? And start this sketch, which then will use the defined ID or request a new ID from controller and writes the eeprom? During booting, MYSBootloader calculates the FW CRC in flash and verifies it against the FW CRC stored in EEPROM (which is written after a successful OTA FW update) - if it matches, the sketch starts, if not, the bootloader remains active.
  • 13 Votes
    198 Posts
    85k Views
    I
    @tekka Is there any changelog to it also or it was just made officially available again? although last online status was 22 AUG 2020, so anyone else can confirm anything about it? I'd just be cautious without confirmation.
  • [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5

    Pinned
    86
    16 Votes
    86 Posts
    103k Views
    E
    @emre299 when you click on Burn Bootloader, you get these errors avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03 So you verified the connections. Did you verify also with a multimeter? A wire can be broken internally Do you have another pro mini to verify the connections? I would try different settings like the normal settings 3.3V and 8Mzh externally, etc If this does not work, I have no ideas anymore...
  • Combining MySensors examples

    Pinned
    12
    5 Votes
    12 Posts
    20k Views
    TRS-80T
    Video in OP was good for "beginner" but you very quickly run into other issues. For me it was getting confused by lots of talk about interrupts (in relation to "input" type sensors). All of Build pages for these type of sensors mention about interrupts only being available on pins 2 and 3 (assuming Arduino Pro Mini, etc.). Which only confused me further (at first). However maybe you are smarter than me. ;) But look closely, most (all?) of MySensors code I have seen for "inputs" (door, motion, etc.) actually DO NOT use interrupts! Notice the code runs right in the main loop. Interrupts are only needed when you sleep the node! Everything I talk about here is for always powered nodes, where you do not need to sleep because you are not on batteries. For batteries you need to sleep to save power, and then we have to do things different. Then you will need to use the hardware interrupts, to wake the node from sleeping. But that I will call "advanced" and beyond the scope of this particular post here, which I am calling "intermediate". So, back to that... You can use any pin you want (almost) for inputs when you are not sleeping the node. OP video does mention about non blocking code, but he does not go into detail. I don't know why not, as it is not complicated. You simply do wait() instead of sleep(). Or, if you are combining one or more thing(s) that needs to "listen" all the time (lets say, an actuator/relay, and for fun let's add a motion sensor, too!), with something that needs to send() periodically (let's say a temperature sensor) then you just keep looping over and over checking all your inputs, and then only enter the output (temperature) part of the code every so many millis(). An example: void loop() { // put code here to check motion sensor (copy from loop() part of motion sensor sketch) // now we check if enough time has passed to check temperature, if so we enter this subroutine if ( millis() > millisLastTemperature + TEMPERATURE_CHECK_INTERVAL ) { // put code here to check temperature sensor(s) // Right before we exit temperature subroutine, note current time as last time temperature was sent. millisLastTemperature = millis(); } // That's it for main loop() } // the relay needs code to receive incoming messages void receive(const MyMessage &message) { // Put code here from receive() part of relay sketch } Doing this way, you could even combine multiple sensors (temperature, humidity, light, etc.) to take readings even on different intervals. Just duplicate that subroutine, and give each one their own <SENSOR>_CHECK_INTERVAL variable. Just remember to define all your variables at the top of the sketch, and when dealing with millis() you want to use data type of unsigned long. Speaking of which, I think you also must have some very basic programming or even logical skills. But there is a lot of information in Internet nowadays, so hopefully you can study and teach yourself enough to get by. Good luck, and don't hesitate to post if you run into trouble. Don't suffer along in silence and then give up, without saying anything to anyone. Ask me how I know. ;)
  • ESP8266 WiFi gateway port for MySensors

    Pinned
    328
    14 Votes
    328 Posts
    310k Views
    mfalkviddM
    @ahmedadelhosni where is gpio15 used? (This is a very long thread so finding it without your help isn't easy)
  • [security] Introducing signing support to MySensors

    Pinned security
    491
    20 Votes
    491 Posts
    334k Views
    AnticimexA
    @alowhum progress on that is best viewed here: https://github.com/mysensors/MySensors/issues/1118 Progress is quite slow at the moment because I am busy with other things of personal nature, like buying a house and moving into it, so don't expect much to happen this year (unless anyone would like to help out :))
  • Imitating a LoRaWAN(R) with ESP8266/ESP32 and MySensors

    3
    0 Votes
    3 Posts
    21 Views
    OldSurferDudeO
    @mfalkvidd Yes, I understand that 253 is the software limit. I was wondering about the hardware limit. For example, my Asus router has a software limit of 253 devices. But when I get 20-25 WiFi devices trying to connect, the network goes haywire. (pun intended ;) ) I am quite convinced that this is a hardware limitation of the router because the router has to carry some information about each connection. If the gateway is dumb, that is, carries no information about any connection, then it could truly have 253 connections. After a bit of contemplation, I realize that the name, gateway, implies this. If that is the case, it is good news for the DiY'er in that this very inexpensive and cheap hardware could stand in for a LoRaWAN, again, with a number of compromises.
  • PJON and Minicore not working

    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • Home Assistant/MySensors quirks

    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • MQTT-Help me understand about the MQTT Gateway.

    11
    0 Votes
    11 Posts
    60 Views
    OldSurferDudeO
    @dpcons MQTT sounds intimidating and looks imitimidating when you see all of the options available. Here's the scenario: You want to send a message. That's the -m option followed by a space and the message between " " the location, topic, is a tree, -t option, separated by forward slash / eg. MyRootTopic/MyTopicsSub/MyTopicSubSub It's as easy as that if your broker, the MQTT service (program) is on the same computer as the sending program. Usually it's not. Specifiy the location, the host, of the broker with the -h option followed by the host name or IP address The retain option, -r is important but explaining it is beyone the scope of this message Receiving, subscribing, to a topic is just the same, but you wouldn't have the -m message If you subscribe from the command line, the subscribe function waits indefinitely for messages published to the subscribed topic (unless you use the -C option) ^C to terminate the command. A tamotized device with the MQTT configured will create a number of topics on the broker. Home Assistant will see this automatically, if you have the Tasmota and MQTT Integrations installed. The MySensors MQTT gateway takes care of MQTT communication for a MySensors device. Again the MySensors and MQTT integrations. I use both. -OSD
  • Adding Listen only device to my system.

    5
    0 Votes
    5 Posts
    27 Views
    dpconsD
    @mfalkvidd Thanks for the info!
  • Sending offset to node

    3
    0 Votes
    3 Posts
    42 Views
    B
    Thanks for the idea, i will look into it soon, will let know how it goes..
  • Saving last known good state, but not in EEPROM

    6
    0 Votes
    6 Posts
    36 Views
    S
    @OldSurferDude jus request counter states from controller on each reset, worked fine with Domoticz... or save in eeprom but increase location every write, on power up/reset search eeprom for largest value stored and carry on from that location, one long integer will fit 256 times in atmega328(p) eeprom, is that long enough for you ;) ?
  • Radio waking up for no reason.

    3
    0 Votes
    3 Posts
    38 Views
    S
    Over 4 years on, and my node ran continuously sending 4 messages every 5 minutes. It's 700mAh LiFePo4 battery voltage dropped from initial 3.45V to 3.24V, according to LiFePo4 voltge/SoC tables It's just under 40% left. 700*60% = 420mAh. 100 mAH per year. using library 2.40 and blob message I could cut usage to ~25mAh/year, not bad
  • Gateway without a radio

    3
    0 Votes
    3 Posts
    32 Views
    mfalkviddM
    @OldSurferDude yes, just run the configure command with --my-transport=none
  • Counting Incoming and Outgoing Messages from a Gateway

    3
    1 Votes
    3 Posts
    28 Views
    T
    @mfalkvidd Thank you very much, that's exactly what I was looking for!
  • LAN8720A - will mysensors work with this module

    3
    0 Votes
    3 Posts
    25 Views
    MarcinM
    Thanks for the answer. I meant that Mysensors has ESP32 support but only in terms of WIFI. It supports e.g. stm32 with ENC or W5500 modules - and the question is whether and how to add ESP32 support with LAN8720 module. I am not considering using ESPHOME or MQTT - I want to have native communication with the controller that implements my control schemes on its side. I try to program KC868-A16 but it does not matter - the question is whether such support can be added in a simple way.
  • 0 Votes
    3 Posts
    22 Views
    K
    Thanks, I'll keep this in mind if I decide to debug it. I realized that I am also tired of patching the gateway through to the doctor container inside an LXC so now I am looking at creating an esp gateway. Just need to check if I can find a pcb on here. Thanks again!

7

Online

11.7k

Users

11.2k

Topics

113.0k

Posts