Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. JeeLet
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by JeeLet

    • RE: MQTT losing messages...

      here can be the beginning of an answer:
      https://forum.mysensors.org/topic/812/realtimeclockdisplaysensor-ino-no-fetch-time-from-controller

      "I don't know where to start," ... in a chain there are
      links, see which one is at fault

      "defective" since the migration from serial to mqtt" ...? what does it mean?

      I dialogue with you, but without really knowing, just to create a chain reaction of ideas 🙂

      maybe others have an idea !??

      Translated with www.DeepL.com/Translator (free version)

      posted in OpenHAB
      JeeLet
      JeeLet
    • RE: MQTT losing messages...

      Hello

      can you tell us more about your mysensors architecture.
      see the chain of elements, hardware and software.

      your message is about : Mqtt 'mosquitto? - OpenHab - Arduino" uno?"

      posted in OpenHAB
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      hello

      did you find some time to add the CAN bus error feedback?

      the 2 and 3 is good, enough 💃

      and give me the procedure for the sketch 🙂

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      sorry for the alert.

      it was an error in the gateway sketch

      a ... #define MY_WITH_LEDS_BLINKING_INVERSE... duplicate, is misplaced

      désolé

      go to a fourth node
      (Gw0 - Nodes 55 56 57 58 )

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      .. bip bip

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      "Are my ideas good" .. yes yes c'est tout bon

      "It will not flash the diodes in case of communication problems" ... it's not a problem, Christmas is still far 🙂

      But yes a counter that increments is a good thing.

      what do you want me to test ????

      bool transportSanityCheck(void)
      {
      	return (CAN0.getError()==CAN_OK)
      }
      

      The "radio guy" opinion would be great.
      ((I'll look for possible help ). )

      Re-Edit

      hal/transport/CAN/MyTransportCAN.cpp

      bool transportSanityCheck(void)
      {
      	// not implemented yet
      	return true;
      }
      

      😜

      Edit
      I searched the web, and using SNR RSSI with the CAN bus is a dead end.
      https://www.thethingsnetwork.org/docs/lorawan/rssi-and-snr/

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      The original idea was: how to check the status of the CAN bus.

      . is there any dialogue ?
      . are there any messages?

      of course this can be done with MySensors.

      But to get as close as possible to the communication channel (the CAN bus) I thought it was easy to do.

      this is by reading the post of bricoleau here
      text french
      that the idea came to me.

      • on the arduino have a blinking led to say that the CAN bus is out of order (but we forget, it loads the program unnecessarily)

      and also because you suggested it to me
      yes we have to beat the iron when it is hot, and my time available for the computer will soon be reduced (purchase and work of a house)

      I appreciate very much your explanatory note, thank you

      I activated the 16Mhz in the sketch, and put it back in the library

        #define MY_NODE_ID 57          /*Node en ID static*/
      
        #define MY_CAN
        #define CAN_CLOCK MCP_16MHZ
      
      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      Thank you for this clarification.
      (yes translator and my neuron it gives crooked dialog)

      "If I have missed a relevant property, please let me know."

      The list of #define go up for the MySensors sketch .
      ( if I'm not mistaken ?)

      ***for MCP_CAN_lib **************** MyConfig.h line 280 to 315
      CAN_INT // Pin for interrupting an incoming message.
      CAN_CS // Chip selection pin.
      CAN_SPEED // Transmission speed. The allowed values can be found in mcp_can_dfs.h
      CAN_CLOCK // Can clock. Allowed values can be found in mcp_can_dfs.h.
      CAN_BUF_SIZE // Assembly buffer size. As long messages can be split and arrive mixed with other messages, an assembly buffer is needed.
      
      **** for MyS **************** MyConfig.h line 2492 to 2494
        MY_CAN // Set this to use the CAN wire transport for sensor network communication.
      MY_DEBUG_VERBOSE_CAN // Set this for verbose debugging printouts related to the %CAN driver.
      

      can be added, for testing and controlling the CAN bus

      #define CAN_MSGAVAIL    
      #define CAN_OK  
      #define CAN_CTRLERROR  
      

      Thanks

      return of the last 24 hours .
      CAN bus no error, good dialogue, no hole in the measurements and commands.

      the hardware base on the bus is :
      gateway + node 55 + node 56 .

      I will add another node 57.
      I think to go until 6 nodes

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      I just did the test, switch to 16Mhz in the file MyConfig.h

      it works well, I have no error

      #define CAN_CLOCK MCP_16MHZ
      

      I didn't think it was possible, is it incompatible?
      overwritten the values of the file MyConfig.h

      thank you for the information

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      " I would suggest doing a long term test to see if it is stable." yes I will stress it to see the weakness

      ".. If it is stable, try to use it in real use cases." yes that's the point

      One last question

      I'm going from 8Mhz to 16Mhz (in development/MyConfig.h on line 306)

      question: can you explain how I can bring up in the sketch the parameters that are related to the MCP_CAN_lib library

      it should not be complicated for me 🙂 it is only text to insert ???

      an example with the #define CAN_CLOCK MCP_8MHZ

      Thanks Adam Slowik

      posted in Development
      JeeLet
      JeeLet
    • RE: Error compiling mysensors in beaglebone black

      http://learntohackit.com/intro/# it can be useful information ???

      posted in Troubleshooting
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      Gateway Logs on MyController
      (CAN Bus and RS485 Bus)

      two separate files
      CAN log
      RS485 log

      files split in parts :
      A : gateways startup
      B : reboot of the gateways
      C : launch of MyClock Nodes (id23 and id55)
      D ; periodic refresh requestTime(receiveTime)
      E ; send value (1700 and 2100)

      (I have prepared the work for you to read)

      a 1st analysis

      • (at the bottom of the listing, the sending of values "1700 or 2100" with MyC)
        The RS485 bus dialogues much more, the CAN bus is more timid 🙂

      Adam Slowik bravo

      I test what now???
      the ACK ??

      Oh yes, I have to check the disconnection of the nodes.
      The Gateway gives me the impression that the information does not go back to MyC if a Node is off ???

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      a test with DHT22 probes.

      the values go up well on MyC
      real decimal values 🙂

      here is a screen shot

      big vue

      I have to find another type of probes, the DHT22 give me losses, or my sketch is to review

      ReEdit
      error 😠
      I got excited too fast
      the values are not refreshed.
      I look better 👓

      ReRe-edition
      I made a mistake, as I play a little too much with MyController, I add and remove gateways from nodes and other salads.
      and well in the end it makes no sense 😉

      I cleaned up the Yaml files of MyC and it's better 🙂

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      #define MY_DEBUG_VERBOSE_CAN .....yes yes I already tested it, it's very good.
      (a very useful function)

      ..go to

      • Reloading the CAN-MyS update
      • ClearEeprom of the GW and Nodes
      • Reloading of Sketches on GW and Nodes

      Bravo 🏋️‍♀️

      • sendSketchInfo(" text ...."); and well up

      • requestTime(receiveTime); and functional

      Ahhhhhh Lovely this is great 🌈
      I offer the coffee crossing 🥐 ☕

      (what was the problem ??? )

      After the test on the Digital I/O of the Nodes ,
      now I test the Analog I/O

      a Super Thank You @Adam-Slowik
      👍

      posted in Development
      JeeLet
      JeeLet
    • RE: MySensors 2.3.2 released

      what would you like as a novelty ???

      " MySensors is dead ?" ... No, in my house it is still alive.

      but it's true you are right to ask the question.
      the programmers, the creators are always The ????? 🙂

      what!? bought by the competition so that MySensors does not evolve any more? it makes damage to the commercial product 🙂

      posted in Announcements
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      in the sketch I added lines to visualize the buffer data

      a part of I recopied

      log IDE :

      newTime:0   -------------------------------------------  
         Extended ID: 0x0410FF00  DLC: 8  Data: 0x00 0x00 0xFF 0x0A 0x23 0x14 0xFF 0x00
      88010 TSF:MSG:SEND,55-55-0-0,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      Extended ID: 0x05103700  DLC: 7  Data: 0x00 0x00 0x37 0x02 0x13 0x01 0xFF
      Extended ID: 0x06303700  DLC: 8  Data: 0x00 0x00 0x37 0x52 0x03 0x01 0xFF 0x31
        newTime:0   ------------------------------------------- 
      

      I stop for me, I pause for 1 day or 2 🙂

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      frequency change

      with 16Mhz I have a NACK

      // #define CAN_CLOCK MCP_16MHZ
      105 TSM:FPAR
      18107 ?TSF:MSG:SEND,55-55-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=4,st=NACK:
        newTime:0   -------------------------------------------  
           time current:0   -------------------------------------------  
      20115 !TSM:FPAR:NO REPLY
      20117 TSM:FPAR
      20119 ?TSF:MSG:SEND,55-55-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=5,st=NACK:
      
      // #define CAN_CLOCK MCP_8MHZ
      8004 TSF:MSG:SEND,55-55-0-0,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      28014 TSF:MSG:READ,0-0-55,s=255,c=3,t=1,pt=0,l=0,sg=0:
      28019 TSF:MSG:ECHO
        newTime:0   -------------------------------------------  
           time current:0   -------------------------------------------  
      38005 TSF:MSG:SEND,55-55-0-0,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      38016 TSF:MSG:READ,0-0-55,s=255,c=3,t=1,pt=0,l=0,sg=0:
      

      https://forum.arduino.cc/t/how-to-set-the-mhz-in-mcp2515-library-file-based-on-crystal-oscillator/628822

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      I think the dialogue is good
      but the problem is the length of the storyline

      a part of the dialog on the IDE terminal for both types
      CAN and RS485

         - IDE terminal sur RS485 :
      
      4066 TSF:MSG:ECHO
      4132 TSF:MSG:READ,0-0-22,s=255,c=3,t=1,pt=0,l=10,sg=0:1655285320
      8018 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      8054 TSF:MSG:READ,0-0-22,s=255,c=3,t=1,pt=0,l=0,sg=0:
      8058 TSF:MSG:ECHO
      8111 TSF:MSG:READ,0-0-22,s=255,c=3,t=1,pt=0,l=10,sg=0:1655285324
        newTime:1655285324   -------------------------------------------  
      
      
        - IDE terminal sur CAN :
      
      22224 MCO:REG:REQ
      22226 TSF:MSG:SEND,55-55-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      22233 !MCO:PRO:RC=1
      22235 TSF:MSG:READ,0-0-55,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      22240 MCO:PIM:NODE REG=1
      28004 TSF:MSG:SEND,55-55-0-0,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      28014 TSF:MSG:READ,0-0-55,s=255,c=3,t=1,pt=0,l=0,sg=0:
      28019 TSF:MSG:ECHO
        newTime:0   -------------------------------------------  
      

      sketch

      void receiveTime(unsigned long controllerTime)   {   
          if (receiveTime) stateCom = true ; else stateCom = false;
            newTime = controllerTime;
      " " ....
      Serial.print("  newTime:"); Serial.print(newTime);
      
      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      no it stayed on 8Mhz ?

      I didn't modify anything (the other sketches work)

      But I just looked at the quartz and it's 16M!! (SW-65-16M)

      I am lost 😞

      https://www.gotronic.fr/art-module-bus-can-sbc-can01-28405.htm

      but on the doc there is :
      The 8000000 stands that the MCP2515 operates with a clock of 8 MHz. This
      depends on the quartz used and may need to be adjusted.

      error
      on the official doc it's a 16Mhz like mine.

      • https://www.joy-it.net/en/products/SBC-CAN01
        OSCILLATOR 16 MHz Crystal Oscillator

      so 8Mhz or 16Mhz?
      and why does it work with the previous sketches?

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      @Adam-Slowik "Could you post the CAN version here?"

      it's the same, except that the bus is not rs485 but CAN 🙂

      ......
      ........
      #define MY_NODE_ID 55          /*Node en ID static*/
      
        #define MY_CAN
        
        #include "SSD1306Ascii.h"
      ........
      .....
      

      but I'll go back to PaulStoffregen's Lib <TimeLib.h> to see if I can simplify the basic sketch of MySensors

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      I tested my sketch with clock and OLED to see 🙂

      bah No the time is not up 😞

      I give this information for an overview, it can help for the continuation (but not to give you work 🙂 )

      The listing of the messages of mySensors

      test with "void receiveTime" function (without RTC clock)
      https://forum.mysensors.org/topic/4809/real-time-clock-module-lcd-display-and-controller-time/8?_=1655208396048

      ..........Log MyC - terminal ssh  .........
      2022-06-14T14:01:45.115+0200	recd	0;255;3;0;9;65310350 TSF:MSG:READ,55-55-0,s=255,c=3,t=1,pt=0,l=0,sg=0:
      2022-06-14T14:01:45.119+0200	recd	0;255;3;0;9;65310356 TSF:MSG:ECHO REQ
      2022-06-14T14:01:45.127+0200	recd	0;255;3;0;9;65310360 TSF:MSG:SEND,0-0-55-55,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      2022-06-14T14:01:45.127+0200	recd	55;255;3;0;1;
      2022-06-14T14:01:45.146+0200	sent	55;255;3;0;1;1655215305
      2022-06-14T14:01:45.160+0200	recd	0;255;3;0;9;65310394 TSF:MSG:SEND,0-0-55-55,s=255,c=3,t=1,pt=0,l=10,sg=0,ft=0,st=OK:1655215305
      
      
      ..........Log MyS - terminal IDE .........
           time current:0   -------------------------------------------  
      58007 TSF:MSG:SEND,55-55-0-0,s=255,c=3,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      58017 TSF:MSG:READ,0-0-55,s=255,c=3,t=1,pt=0,l=0,sg=0:
      58022 TSF:MSG:ECHO
      

      avec Bus RS485

      
      ..........Log MyC - terminal ssh  .........
      2022-06-14T14:22:41.265+0200	recd	0;255;3;0;9;72000090 TSF:SAN:OK
      2022-06-14T14:22:41.274+0200	recd	0;255;3;0;9;72000096 TSM:READY:NWD REQ
      2022-06-14T14:22:41.298+0200	recd	0;255;3;0;9;72000115 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
      2022-06-14T14:22:41.917+0200	recd	0;255;3;0;9;72000736 TSF:MSG:READ,22-22-0,s=255,c=3,t=21,pt=1,l=1,sg=0:0
      2022-06-14T14:22:41.920+0200	recd	22;255;3;0;21;0
      
      
      .........Log MyS - terminal IDE .........
         time current:1422   -------------------------------------------  
      423956 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=1,l=1,sg=0:0
      423962 TSF:MSG:BC
      424008 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
         requestOn----------------------------------------- 
      
      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      @Adam-Slowik "Can you push your patch to my repository? " .... I don't know how

      On the CAN principle

      @Adam-Slowik "Based on this id, the filters are configured to remove all messages not intended for the current node. This way, if the gateway wants to send a message to the node with id = 51, only the node with that id receives that message." ... yes, that's how I see it.

      another way to say/explain it.

      "The philosophy of CAN is to constitute a messaging system.
      The messages (the letter) send on the CAN Bus (the post office), distributed by the CAN Bus (the letter carrier).

      Each (letter) have each an identifier (stamp of the post ☺ ) that ... identifies it.
      And put in the right mailbox (the MCP2515) according to the choice of filter/mask ( color, scent? ☺ ) of the letter."

      So there are two "stratum" of dialogue / work.

      • one on the Can Bus, and another on the Nodes.

      The idea is to relieve the Nodes of unnecessary work/effort with the risks that this brings. Less letter to open 🙂

      @Adam-Slowik "... my modules and arduinos are buried in a box in my attic..." ? Arduino 8bit and MySensors is over for you?
      ( if it's a personal / family reason don't say anything )

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      "Can you provide logs (gateway/node) from the reset scenario. It would be great to have these logs for RS485 and CAN so I can compare them."

      listing

      Released today 2 gateways connect to MyController

      • UNO_usb - Gateway and RS485 bus
      • UNO_usb - Gateway and CAN Bus

      with connect, a UNO with the basic sketch "RelayWithButtonActuator_base.ino" (slightly modified)
      with ... a Led and a Switch, for each bus.

      The Listing split in several parts

      "Log of the IDE and MyC for the two types of bus (node34 and node 54), CAN and RS485.

      - Listing Action RESET with MyController 
      	2 parts for CAN
      	and 
      	2 parts for RS485
      	
      
      and 
      
      - Listing Action On/Off on the node switch or with MyController 
      	4 parts for CAN
      	and 
      	4 parts for RS485
      

      No error on the Reset, it works fine, an error from me.

      Oh yes, I even found an error 🙂
      the sendSketchInfo("test xxxxx", "1.0"); is not up

      see the end of the video
      video

      ....I will answer the other question tomorrow.

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      test with the digital output inputs of 2 Arduino on CAN Bus.

      • status of a button and control of a led with MyC

      a proof in video that it is functional 🙂

      video

      all is not functional, on the end of the video, the reset or reboot does not work, (but functional with the RS485 bus)
      .... to follow 😉
      (now the Analog values, decimal to test )

      I would like to test the Node to Node with the filtering.
      a question : is it difficult to put the filters on the MySensors sketch ???

      there are still MySensors on the forum ???
      if yes, a help for Adam Slowik would be a great thing.
      implement it in MyS Yes Yes

      Thanks

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      a topo of the day

      on the hardware side, I got screwed with an arduino pin that became too soft, too dilated, look for an hour before understanding why no dialog.

      Otherwise, on the Gateway side, no problem, MyController recognized well.

      and CAN_Switch.ino is good too, my Widget on MyC switches well on the switch change.

      listing of the dialog pour le Node 51 (set up in a fixed place )

      coter log from MyC:

      2022-06-11T18:49:35.167+0200	recd	0;255;3;0;9;1482640 TSF:MSG:READ,51-51-0,s=4,c=1,t=16,pt=1,l=1,sg=0:1
      2022-06-11T18:49:35.170+0200	recd	51;4;1;0;16;1
      2022-06-11T18:49:35.179+0200	recd	0;255;3;0;9;1482653 TSF:MSG:READ,51-51-0,s=255,c=3,t=21,pt=1,l=1,sg=0:0
      2022-06-11T18:49:35.182+0200	recd	51;255;3;0;21;0
      

      coter IDE from MyS:

      67889 TSF:MSG:BC
      68197 TSF:MSG:SEND,51-51-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
      68203 TSF:MSG:READ,0-0-255,s=255,c=3,t=20,pt=0,l=0,sg=0:
      
      68208 TSF:MSG:BC
      68836 TSF:MSG:SEND,51-51-0-0,s=255,c=3,t=21,pt=1,l=1,sg=0,ft=0,st=OK:0
      
      68843 MCO:SLP:MS=5,SMS=0,I1=255,M1=255,I2=255,M2=255
      68848 TSF:TDI:TSL
      68849 MCO:SLP:WUP=-1 ........ it is incomplete 
      

      well now we have to calm down the CAN bus dialog, the Rx/Tx Led of the gateway looks like a Christmas tree 🙂

      tomorrow I'll test a CAN_Switch version2 sketch

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      https://sourcecodeartisan.com/2021/03/06/invalid-suffix-on-literal.html

      for the Error code it is
      a requirement in C++ 11 (or later).

      lines 163 and 228 modify and error resolved

      .../hal.transport/CAN/MyTransportCAN.cpp

      CAN_DEBUG(PSTR("CAN:SND:CANH=%" PRIu32 ",ID=%" PRIu8 ",TOTAL=%" PRIu8 ",CURR=%" PRIu8 ",TO=%" PRIu8 ",FROM=%" PRIu8 "\n"), header, messageId, totalPartCount,
      
      CAN_DEBUG(PSTR("CAN:RCV:CANH=%" PRIu32 ",ID=%" PRIu32 ",TOTAL=%" PRIu32 ",CURR=%" PRIu32 ",TO=%" PRIu32 ",FROM=%" PRIu32 "\n"), rxId, messageId,
      

      👍

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      a start of error messages return (on both sketches)
      IDE version 1.8.19

      for CANSwitch.ino

      the message returns me to the line
      MyTransportCAN.cpp --->
      163 : ",TOTAL=%"PRIu8",CURR=%"PRIu8",TO=%"PRIu8",FROM=%"PRIu8"\n"), header, messageId, totalPartCount,
      228 : ",TOTAL=%"PRIu32",CURR=%"PRIu32",TO=%"PRIu32",FROM=%"PRIu32"\n"), rxId, messageId,

      the one copy (a part) of the IDE

      In file included from /home/mci/Arduino/libraries/MySensors-development/MySensors.h:395:0,
                       from /tmp/arduino_modified_sketch_39381/CANSwitch.ino:43:
      /home/Arduino/libraries/MySensors-development/hal/transport/CAN/MyTransportCAN.cpp:163:17: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
                       ",TOTAL=%"PRIu8",CURR=%"PRIu8",TO=%"PRIu8",FROM=%"PRIu8"\n"), header, messageId, totalPartCount,
                       ^
      /home/Arduino/libraries/MySensors-development/hal/transport/CAN/MyTransportCAN.cpp:163:32: war......
                                                                ^...
      /home/Arduino/libraries/MySensors-development/hal/transport/CAN/MyTransportCAN.cpp:228:18: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
                        ",TOTAL=%"PRIu32",CURR=%"PRIu32",TO=%"PRIu32",FROM=%"PRIu32"\n"), rxId, messageId,
                        ^
      /home/Arduino/libraries/MySensors-development/hal/transport/CAN/MyTransportCAN.cpp:228:34: warni.....
      
      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      Hello

      to save time, you can tell me more about the configuration of MCP_CAN_lib

      not all settings are shown on the MyS sketch 🙂

      here in an example https://github.com/coryjfowler/MCP_CAN_lib/blob/master/examples/CAN_receive/CAN_receive.ino
      there are some parameters to adjust

      or the filters https://github.com/coryjfowler/MCP_CAN_lib/blob/master/examples/Extended_MaskFilter/Extended_MaskFilter.ino

      can you indicate me the files in question ???
      (I think I have found but to confirm)

      to make it clean

      thanks

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      "you can choose a different library"
      I like this freedom of choice, my questioning is not necessary 🙂

      "I would really appreciate your comments"
      yes yes in 4 to 5 days, theoretically

      Finally a high reliability Wired Bus for MySensors with the MyS protocol which is extraordinarily rich.
      (the RS485 bus is good, but the cables/wiring must be more rigorous and the management of collisions more delicate for X Nodes, and the CAN bus is a good field bus )

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      Hello
      thank you for the answer

      questions:

      • which CAN library did you start on,
        mcp2515.h or mcp_can.h ...etc

      • the management of Float values is also managed ?
        (numbers with decimals )
        like this library which manages Floats https://github.com/pierremolinaro/acan/search?q=float

      • and of course any CAN card is managed, like this one https://www.gotronic.fr/ori-module-bus-can-sbc-can01-28405.jpg

      I prepare another test computer for the installation of your version 🙂

      Translated with www.DeepL.com/Translator (free version)

      posted in Development
      JeeLet
      JeeLet
    • RE: CAN bus transport implementation

      a request for information, how to do :

      to add the CAN transport you have to modify the files or replace them with what exists ?

      • MyTransportCAN.cpp
      • MyTransportHAL.h
        https://github.com/mysensors/MySensors/pull/1488/commits/492aa631298d5960b4060f94084cdafaaad18f21

      I will maybe test the work of AdamSlowik

      AdamSlowik created this issue in mysensors/MySensors

      open Add CAN transport layer #1488

      posted in Development
      JeeLet
      JeeLet
    • RE: 💬 Real Time Clock Module, LCD Display and Controller Time

      good evening

      again a new sketch for the "void receiveTime" function
      (without RTC clock)

      • start synchronization with the controller and regularly for the drift of the arduino.
      • display time and date on an OLED screen
      • error message when a loss of communication with the controller occurs

      a video "https://www.casimages.com/v/RSWTNb-vokoscreen-2022-05-24-19-33-49.mp4.html"

      /*
       * LIBRAIRIE:
       *  MySensors v2    : https://github.com/mysensors/MySensors
       *  TimeLib.h       : https://github.com/PaulStoffregen/Time
       *  SSD1306Ascii.h  : https://github.com/greiman/SSD1306Ascii
       *
       * MATERIEL:
       *    Arduino Uno
       *    -Afficheur OLED 0,96" I2C TF052 / circuit SSD1306.
       *    bus TTLModule RS485
       * 
       * REVISION HISTORY
       *  base de Henrik Ekblad 2013-2015 et autres :)
       *  ajout bus RS485 et OLED
       * 
       * DESCRIPTION
       *  demander Date et Heure au  contrôleur et l'affiche sur ecran OLED 
       *  Request date and time from the controller and display it on OLED screen 
       *  
       *  Connectique i2c:
      *   Arduino :  A4   A5
      *   OLED    :  SDA  SCL
       *  
       */
      //-- The sketch uses 11932 bytes (36%) ----global variables use 839 bytes (40%)-----------
      //-
      //------------ 2022 ----------------------- Fonctionnelle avec MyC et MyS------------------- 
      
        //#define MY_DEBUG                  /*Enable debug prints to serial monitor*/
        #define MY_TRANSPORT_WAIT_READY_MS 3000  /*Timeout (ms) pour mis en Com.(0 pour aucun)*/
        #define MY_NODE_ID 22          /*Node en ID static*/
      
      /* ----- Module RS485 ----*/
        #define MY_RS485                  /*Apl du transport RS485 (protocol?)*/
        #define MY_RS485_DE_PIN 2         /*Cmd DE pin*/
        #define MY_RS485_BAUD_RATE 9600   /*Set RS485 baud rate to use*/
      //#define MY_RS485_HWSERIAL Serial1 /*pour port Serial autre*/
        
        #include "SSD1306Ascii.h"
        #include "SSD1306AsciiAvrI2c.h"
        
        #include <MySensors.h>  
        #include <TimeLib.h> 
      
        #define CHILD_ID 22       /* MyS numero du Node*/
      
        #define I2C_ADDRESS 0x3C                        /*i2c adresse*/
        
        #define RST_PIN -1  // Define proper RST_PIN if required.(oled)
         
        SSD1306AsciiAvrI2c oled;  //type de com oled
      
      //----- MyS ------
          bool timeReceived = false;  
          bool stateCom = false;
          unsigned long lastUpdate=0, lastRequest=0 , lastmillis = 0;
          unsigned long newTime = 0, oldTime = 0, ComTime = 6000;
      
      //---------------- SETUP ----------------------------
      
        void setup()  {  
      
      //--- OLED ----
        #if RST_PIN >= 0
          oled.begin(&Adafruit128x32, I2C_ADDRESS, RST_PIN);
        #else // RST_PIN >= 0
          oled.begin(&Adafruit128x32, I2C_ADDRESS);
        #endif // RST_PIN >= 0
      
          oled.setFont(Adafruit5x7);         /*font Oled*/
          // oled.setFont(font8x8);             //bien 
          // oled.setFont(Verdana12);           //grand
          // oled.setFont(fixed_bold10x15);     //tres grand   
          // oled.setFont(Arial_bold_14);       //grand sympa 
          oled.clear();
          }
      
      //--------------MySensors-------------
      
        void presentation()  {
          sendSketchInfo("Clock", "2.0");
          }
      
      //------------------ LOOP -----------------------
        void loop() {     
        
      // ---- MyS time --------  
        unsigned long now = millis();
        
         if (now-lastRequest > (ComTime)) {    
                      
            timeReceived = false;
            requestTime(receiveTime);   // Request time from controller. 
            lastRequest = now;
            }
          
      //----- Tempo Display Oled ----------
        if (now-lastUpdate > 10000) {  //10secondes
          lastUpdate = now;
         // Serial.print(" test lastmillis------------ display : "); 
         // Serial.println(timeReceived);
          updateDisplay();
          lastmillis = millis();
      
      
      //----- Stat Com ---
          if (timeReceived == 1) {   //En Com Controller stateCom
            ComTime = 480UL*1000UL;    // 480=8 minutes cycles for Control presence controller 
              }
          else  {           // Erreur Com Controller
            stateCom = false;
            ComTime = 60UL*1000UL;    // secondes for attempted reconnection to the controller 
           // Serial.println(" ----*** Erreur Com Controller *** ---- ");
            }
           }
         } //---Loop
      
       // -------------------- MyS --------------------------------
        void receiveTime(unsigned long controllerTime)   {   
         if (receiveTime) stateCom = true ; else stateCom = false;
          newTime = controllerTime;
          timeReceived = true;
          setTime(controllerTime); // apl pour TimeLib.h
          }
          
      //------------Gestion de l'affichage OLED---------------
        void updateDisplay() {
      
          oled.set1X();           //ligne Message
          oled.setCursor(2, 0);
          printStatDay () ;       // affiche jour de la semaine/poster day of the week
          //oled.print(day());
         
          oled.set2X();           //ligne Heures
          oled.setCursor(18,1);
          oled.print(hour());
          printDigits(minute());
          printDigits(second());
           
          oled.set1X();           // ligne jour mois Année / day month year
          oled.setCursor(35,3);
          oled.print(day());
          printDigitsDay(month());
          printDigitsDay(year());
         }
      
      //-------- Day displaying-------
        void printDigitsDay(int digitday) { //function for Day displaying "0" and separator "/" for day/month/year values
          oled.print("/");
            if(digitday < 10)
              oled.print('0');
              oled.print(digitday);
          }
      
      //-------- Time displaying-------
        void printDigits(int digits) {  //function for Time displaying "0" and separator ":" for hour:minute:sec values
          oled.print(":");
            if(digits < 10)
              oled.print('0');
              oled.print(digits);
          }
      
      //------ conversion date en texte (fonction weekday) et statu Com Controller -----------  
        void printStatDay () {   //function for display Day texte
      
          oled.invertDisplay(!(stateCom)); // inverse N/B Oled sur erreur Com
          if(stateCom == true) { oled.print("com  "); }    //com okai
          if(stateCom == false){ oled.print("Error"); }    //com Error
            // oled.print(stateCom);
              oled.print("  ");
            
         
          if(weekday() == 1) { oled.print("dimanche"); }  //Sunday
          if(weekday() == 2) { oled.print("lundi"); }     //Monday
          if(weekday() == 3) { oled.print("mardi"); }     //Tuesday
          if(weekday() == 4) { oled.print("mercredi"); }  //Wednesday
          if(weekday() == 5) { oled.print("jeudi"); }     //Thursday
          if(weekday() == 6) { oled.print("vendredi"); }  //Friday
          if(weekday() == 7) { oled.print("samedi"); }    //Saturday
      
           oled.print(" ");
           oled.print(day());
         }
      
      //-------------------FIN PGM --------------------------
      
      //------------------- INFO -------------------
      

      why open a new post, there is still some space here 🙂

      posted in Announcements
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      final sketch and functional with MyController

      /*
       *  DESCRIPTION : 4 inputs and 4 outputs on i2C bus with a PCF8574    
       *    
       *  LIBRAIRIES:
       *    - Rob Tillaart pour PCF8574 https://github.com/RobTillaart/Arduino/tree/master/libraries/PCF8574
       *    - MySensors / Arduino Uno    https://github.com/mysensors/MySensors
       *    
       *  ELEMENTS: 
       *    - Expander PCF8574 avec module Metasys JC / 4di 4do - 0X03D i2c adress
       *         
       *  MODIFICATION:  
       *    -x- RAS : Fonctionnelle 
       *    -o-  
       *    -o- 
       * 
       *     (36%) de l'espace de stockage de programmes     
      */
      
         //----------- 9 Mai 2022 ---------------- PCF8574 -4DI-4DO / MyS RS485 et MyC -----------------//
      
      
      //------------------- MyS ---------------------------------
        //#define MY_DEBUG               /*Enable debug prints to serial monitor*/
        //#define   MY_DEBUG_OTA_DISABLE_ECHO //testing
        #define MY_TRANSPORT_WAIT_READY_MS 3000 /*Tempo de mis en Com (millisecondes) à placer avant Mysensors.h*/ 
        #define MY_NODE_ID 40          /*Node en ID static*/
      
      /* ----- Module TTL-RS485 ----*/
        #define MY_RS485                  /*Apl du transport RS485 (protocol?)*/
        #define MY_RS485_DE_PIN 2         /*Cmd DE pin*/
        #define MY_RS485_BAUD_RATE 9600   /*Set RS485 baud rate to use*/
        #define MY_REPEATER_FEATURE       /*Activer fonctionnalité de répéteur du nœud*/
        
        #include <MySensors.h>
      
      //---------------- PCF -------------------------------
        #include "PCF8574.h"
        PCF8574 PCF27a (0x3D);  // adjust addresses i2c pcf8574
      
      // ------ objet ------
        #define CHILD_ID_B0 0    /*Id IN - bp */
         #define CHILD_ID_B1 1    
          #define CHILD_ID_B2 2    
           #define CHILD_ID_B3 3    
        #define CHILD_ID_R4 4    /*Id OUT - relay */
         #define CHILD_ID_R5 5    
          #define CHILD_ID_R6 6    
           #define CHILD_ID_R7 7    
             
        #define RELAY_ON 0    //  1  valeur
        #define RELAY_OFF 1    // 0  invers 
         
      //---------- MyS -------------
        
        MyMessage msg0(CHILD_ID_B0,V_TRIPPED);  /*Boton*/
         MyMessage msg1(CHILD_ID_B1,V_TRIPPED);
          MyMessage msg2(CHILD_ID_B2,V_TRIPPED);
           MyMessage msg3(CHILD_ID_B3,V_TRIPPED);
                
        MyMessage msg4(CHILD_ID_R4,V_STATUS);   /*Relay*/
         MyMessage msg5(CHILD_ID_R5,V_STATUS);
          MyMessage msg6(CHILD_ID_R6,V_STATUS);
           MyMessage msg7(CHILD_ID_R7,V_STATUS);
      
          bool info;              // pour info GW sur MyC
          bool state = false;     // output
        //  bool state4 = false;  bool state5 = false;  bool state6 = false;  bool state7 = false;     
          int oldValue0=-1; int oldValue1=-1; int oldValue2=-1; int oldValue3=-1;  // Input
      
      //---------------- SETUP -------------------------
       void setup() {
        
       // Serial.begin(115200); // debug
        
      //--------- testing IsConnected i2c PCfx ------------
        Serial.println(__FILE__);
        Serial.print("PCF8574_LIB_VERSION:\t");
        Serial.println(PCF8574_LIB_VERSION);
      
        if (!PCF27a.begin())   {
          Serial.println("could not initialize...");
          }
        if (!PCF27a.isConnected())   {
          Serial.println("=> not connected");
          }
          else   {
          Serial.println("=> connected!!");
          }  
            
          // ---- info send to gateway ----
        send(msg0.set(info)); send(msg1.set(info)); //input
        wait(200);
        send(msg2.set(info)); send(msg3.set(info));  //input
        
        wait(200); //delays for frames, depending on system load and bus type (wireless or wired) 
        
        send(msg4.set(info)); send(msg5.set(info));   //output
        wait(200);
        send(msg6.set(info)); send(msg7.set(info));  //output
        }
       
      //----------------- MyS ----------------------------
      void presentation() {
        
        sendSketchInfo("PCF8574 x4in/out - node40", "2.0");  /*info version sketch*/
      
      /*Mysenors Enregistre Child sur la Gw*/
        present(CHILD_ID_B0, S_DOOR, "boton0");      /*Boton*/  
        present(CHILD_ID_B1, S_DOOR, "boton1"); 
        wait(200);
        present(CHILD_ID_B2, S_DOOR, "boton2"); 
        present(CHILD_ID_B3, S_DOOR, "boton3"); 
        
        wait(200); //delays for frames, depending on system load and bus type (wireless or wired)         
        
        present(CHILD_ID_R4, S_BINARY, "relay4");    /*Relay*/
        present(CHILD_ID_R5, S_BINARY, "relay5");
        wait(200);
        present(CHILD_ID_R6, S_BINARY, "relay6");
        present(CHILD_ID_R7, S_BINARY, "relay7");
        
        wait(200);
      
        // metric = getControllerConfig().isMetric; 
        }  
      
      //----------------- LOOP ----------------------------
       void loop() {
      
      //----------- MyS input -------------------------------
         int value0 = PCF27a.read(0);
         if (value0 != oldValue0) {
           send(msg0.set(value0==HIGH ? 1 : 0));   //Send new value
           oldValue0 = value0;
        }
      
         int value1 = PCF27a.read(1);
         if (value1 != oldValue1) {
           send(msg1.set(value1==HIGH ? 1 : 0));   
           oldValue1 = value1;
        }
        
         int value2 = PCF27a.read(2);
         if (value2 != oldValue2) {
           send(msg2.set(value2==HIGH ? 1 : 0));   
           oldValue2 = value2;
        }
        
         int value3 = PCF27a.read(3);
         if (value3 != oldValue3) {
           send(msg3.set(value3==HIGH ? 1 : 0));   
           oldValue3 = value3;
        }
      
       }
      
      //----------- MyS out -------------------------------
        void receive(const MyMessage &message) {
      
              if (message.getType()==V_STATUS) { 
                    
         switch (message.sensor) {
            case 4:
                  state= message.getBool();
                  PCF27a.write(4,  state?RELAY_ON:RELAY_OFF);
                  break;
            case 5:
                  state = message.getBool();
                  PCF27a.write(5,  state?RELAY_ON:RELAY_OFF);
                  break;
            case 6:
                  state = message.getBool();
                  PCF27a.write(6,  state?RELAY_ON:RELAY_OFF);
                  break;
            case 7:
                  state = message.getBool();
                  PCF27a.write(7,  state?RELAY_ON:RELAY_OFF);
                  break; 
                  }
               }
            }
      
      //------------------------------ End pgm -------------------------------------  
      
      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      here is a small truth table for the state of the input/output and the values to give to MyController

      pdf image

      #define RELAY_ON 0        //  1 reversal of values
        #define RELAY_OFF 1    //  0 
      

      now only the MyS states to be sent to MyC to find.

      I stop my dialogue 🙂

      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      Hello

      a request for information.
      What value should be given to avoid a difference in the on/off states between the visualization on the controller and the reality on the LEDs of the Expander module?

      • on the Arduino's Mysensors sketch
      • on the configuration of the Field of MyController

      on which feet to start ????

      Another question, how to have the synchronicity of the state of the physical outputs (relays/led) and the view on MyC ???

      with this version of the sketch the state of the outputs is well to go back to the controller after reboot of the Node

      void receive(const MyMessage &message) {
         if (message.getType()==V_STATUS) {
          // Change relay state
          state = (bool)message.getInt();
           PCF27a.write(4,  state?RELAY_ON:RELAY_OFF);
          send(msg4.set(state?RELAY_ON:RELAY_OFF))
      

      but now with this version, the reality is false
      (an augmented reality 🙂 )

      void receive(const MyMessage &message) {
        if (message.getType()==V_STATUS) {
          switch (message.sensor) {
            case 4:
                  state = message.getBool();
                  PCF27a.write(4,  state?RELAY_ON:RELAY_OFF);
            break;
            
      

      the function

      // send(msg4.set(PCF27a.read(4)));
      

      is removed and you can't see how to add it

      merci

      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574
      /*
       * Test PCF8574 avec module Metasys JC / 4di 4do - 0X03D i2c adress
       * 
       *  DESCRIPTION : Exemple pour lire 4 entrée et contrôler 4 Relais 
       *                avec un PCF8574 (la commande et par les 4 entrée)  
       *    
       *   LIBRAIRIES:
       *   - Rob Tillaart pour PCF8574 https://github.com/RobTillaart/Arduino/tree/master/libraries/PCF8574
       *    
       *   ELEMENTS: 
       *    Do : ?     - Digital output / Relay
       *         
       *    Modification:  
       *    -x- 
       *    -o-  
       *    -o- 
       * 
       *     (14%) de l'espace de stockage de programmes     
      */
      
         //-----------2022---------------- PCF8574 / 4DI-4DO  - MyS et MyC   -----------------//
      
      
      //--------------- MyS ---------------------------------
        //#define MY_DEBUG               /*Enable debug prints to serial monitor*/
        //#define   MY_DEBUG_OTA_DISABLE_ECHO //testing
        #define MY_TRANSPORT_WAIT_READY_MS 3000 /*Tempo de mis en Com (millisecondes) à placer avant Mysensors.h*/ 
        #define MY_NODE_ID 40          /*Node en ID static*/
      
      /* ----- Module TTL-RS485 ----*/
        #define MY_RS485                  /*Apl du transport RS485 (protocol?)*/
        #define MY_RS485_DE_PIN 2         /*Cmd DE pin*/
        #define MY_RS485_BAUD_RATE 9600   /*Set RS485 baud rate to use*/
        #define MY_REPEATER_FEATURE       /*Activer fonctionnalité de répéteur du nœud*/
        
        #include <MySensors.h>
      
      //---------------- PCF -------------------------------
        #include "PCF8574.h"
        PCF8574 PCF27a (0x3D);  // adjust addresses i2c pcf8574
      
      // ------ objet ------
        #define CHILD_ID_B0 0    /*Id IN - bp */
        #define CHILD_ID_R4 4    /*Id OUT - relay */
        
        #define RELAY_ON 1
        #define RELAY_OFF 0     
      
        int oldValue0=-1;  // input bp
      
      //---------- MyS -------------
        
        MyMessage msg0(CHILD_ID_B0,V_TRIPPED);  /*Boton*/
        MyMessage msg4(CHILD_ID_R4,V_STATUS);   /*Relay*/
      
         bool info; // pour info GW sur MyC
         bool state = false;
      
      //---------------- SETUP -------------------------
       void setup() {
        
        //Serial.begin(115200);
        
      //--------- testing IsConnected i2c PCfx ------------
        Serial.println(__FILE__);
        Serial.print("PCF8574_LIB_VERSION:\t");
        Serial.println(PCF8574_LIB_VERSION);
      
        if (!PCF27a.begin())   {
          Serial.println("could not initialize...");
          }
        if (!PCF27a.isConnected())   {
          Serial.println("=> not connected");
          }
          else   {
          Serial.println("=> connected!!");
          }  
              PCF27a.begin(0xFF); // turn off all Relays ????
      
          // ---- info send to gateway ----
         send(msg0.set(info)); 
         send(msg4.set(info));     
       }
       
      //----------------- MyS ----------------------------
      void presentation() {
        
        sendSketchInfo("DiDo node 40", "2.0");  /*info version sketch à la passerelle*/
      
      /*Mysenors Enregistre Child sur la Gw*/
        present(CHILD_ID_B0, S_DOOR, "boton");      /*Boton*/  
        present(CHILD_ID_R4, S_BINARY, "relay");    /*Relay*/
        
      /* requetes/demandes à un noeud ou GW une variable*/
        
        request(CHILD_ID_B0, V_STATUS);  /*Boton*/  
        request(CHILD_ID_R4, V_STATUS);   /*Relay*/
      
        // metric = getControllerConfig().isMetric; 
        }  
      
      //----------------- LOOP ----------------------------
       void loop() {
      
      /* ------ MyS input -----------------------*/
         int value0 = PCF27a.read(0);
         if (value0 != oldValue0) {
           send(msg0.set(value0==HIGH ? 1 : 0));   // Envoyer la nouvelle valeur
           oldValue0 = value0;
        }
       }
      
      //--------- MyS out ----------------------------
      void receive(const MyMessage &message) {
         
        if (message.getType()==V_STATUS) {
              
         // Change relay state
          state = (bool)message.getInt();
           PCF27a.write(4,  state?RELAY_ON:RELAY_OFF);
          send(msg4.set(state?RELAY_ON:RELAY_OFF));
         
        }
      }
      
      //------------------------------ End pgm -------------------------------------  
      
      
      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      Operation Expander success

      I show you two sketches, still based on Rob Tillaart library.

      • the 1st one is a basic version without MySensors
        (to understand how the library works)
        an Input (a shunt) controls an Output.
        4 inputs 4 outputs

      • the 2nd one is with MySensors, everything goes up well on MyController, and the 1st time 🙂 (I am surprised 🙂 )

      a request, a hand for the 2nd for a "clean" touch up of the code (or errors to remove ?? )
      Yes code readable for beginners, simple function.

      after cella another video

      Thanks and good night

      /*
       * Test PCF8574 avec module Metasys JC / 4di 4do - 0X03D i2c adress
       * 
       *  DESCRIPTION : Exemple pour lire 4 entrée et contrôler 4 Relais 
       *                avec un PCF8574 (la commande et par les 4 entrée)  
       *    
       *   LIBRAIRIES:
       *   - Rob Tillaart pour PCF8574 https://github.com/RobTillaart/Arduino/tree/master/libraries/PCF8574
       *    
       *   ELEMENTS: 
       *    Do : ?     - Digital output / Relay
       *         
       *    Modification:  
       *    -x- 
       *    -o-  
       *    -o- 
       * 
       * 
      */
      
         //-----------2022---------------- PCF8574 / 4DI-4DO  - JC  -----------------//
      
        #include "PCF8574.h"
        PCF8574 PCF27a (0x3D);
      
      //---------------- SETUP -------------------------
       void setup() {
        
        Serial.begin(115200);
        
      //--------- testing IsConnected i2c PCfx ------------
        Serial.println(__FILE__);
        Serial.print("PCF8574_LIB_VERSION:\t");
        Serial.println(PCF8574_LIB_VERSION);
      
        if (!PCF27a.begin())   {
          Serial.println("could not initialize...");
          }
        if (!PCF27a.isConnected())   {
          Serial.println("=> not connected");
          }
          else   {
          Serial.println("=> connected!!");
          }  
      
       }
      
      //----------------- LOOP ----------------------------
       void loop() {
      
        if (PCF27a.read(0) == LOW)  do4High(); else PCF27a.write(4, HIGH) ;
        if (PCF27a.read(1) == LOW)  do5High(); else PCF27a.write(5, HIGH) ;
        if (PCF27a.read(2) == LOW)  do6High(); else PCF27a.write(6, HIGH) ;
        if (PCF27a.read(3) == LOW)  do7High(); else PCF27a.write(7, HIGH) ;
       
       }
      
      // ------- 4x Relay ON ----------
       void do4High() {
        PCF27a.write(4, LOW);
        }
       void do5High() {
        PCF27a.write(5, LOW);
        }
       void do6High() {
        PCF27a.write(6, LOW);
        }
       void do7High() {
        PCF27a.write(7, LOW);
        }
      
      //------------------------------ End pgm -------------------------------------  
      
      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      in this sketch there is only the Mysensors library to call, to test

      I just have to finalize my sketch and it to MyController

      video

      /************************************************************************************
         Using an Arduino Uno or an ESP8266 on NodeMCU to control buttons
         and relays through a PCF8574 GPIO expander.
         Requires the PCF8574 library
         https://github.com/RobTillaart/Arduino/tree/master/libraries/PCF8574
         If using Uno,     comment out #define intPin D4
         If using ESP8266, comment out #define intPin 2
         GPIO expander pinout:   0..3 = button input 0..3
                                 4..7 = relay output 0..3
         Each button controls a corresponding relay 
         eg. button 0 controls relay 0
         Button functions:   button 0 and 1 toggle relay 0 and 1 on each press
                             button 2 and 3 directly control relay 2 and 3 in "realtime"
         Gadget Reboot
       *************************************************************************************/
      /*     
      *   DESCRIPTION : Arduino UNO et JC-PCF8574 pour 4 Input et 4 Relay   
      *                 pour MySensors RS485
      *     
      *   Libraries: PCF8574 de Rob Tillaart
      * 
      *  Modif/Afaire:
      * -o- 
      * -x- 
      * -o-  
      *   (x%) de l'espace de stockage de programmes               
      *                
      */
           //----------- 2022 ------ PCF8574_RobTi_MyS_4io.ino  ---------- test -----------------//
      
      //--------------- MyS ---------------------------------
        #define MY_DEBUG               /*Enable debug prints to serial monitor*/
        #define   MY_DEBUG_OTA_DISABLE_ECHO //testing
        #define MY_TRANSPORT_WAIT_READY_MS 3000
        #define MY_NODE_ID 40          /*Node en ID static*/
        #define MY_RADIO_RF24
        #include <MySensors.h>
              
      //---------------- PCF -------------------------------
        #include <PCF8574.h>
        #include <Wire.h>
      
        PCF8574 pcf8574(0x3D);
        #define intPin 3                       // interrupt input Uno
      
        volatile bool buttonPressed = false;   // button interrupt flag
        byte buttonReg;                        // button read register
      
      //----------------- SETUP -------------------------
        void setup() {
      
      //initialize PCF8574 with an interrupt pin and set all outputs to '1' (Relays off)
        Wire.begin();
        pinMode(intPin, INPUT_PULLUP);
        attachInterrupt(digitalPinToInterrupt(intPin), buttonISR, FALLING);
        pcf8574.begin(0xFF); // turn off all Relays
        }
      
      //----------------- LOOP ----------------------------
      void loop() {
      
      // if a button press was detected via interrupt, check if the button press
      // occurred on one of the "toggle" control buttons and toggle the relay if so
        if (buttonPressed) {
          delay(50);  // crude debounce
          buttonReg = pcf8574.read8();
      
        if (!bitRead(buttonReg, 0)) {  //toggle a relay if button pressed
          pcf8574.toggle(4);
          }
      
        if (!bitRead(buttonReg, 1)) {  //toggle a relay if button pressed
          pcf8574.toggle(5);
          } 
        }
      
        buttonPressed = false; // clear interrupt flag
      
      // manually poll last two buttons and set relays to match button on/off realtime state
      // method 1:  read all buttons and choose the desired button from the read register
        // buttonReg = pcf8574.read8();
        // pcf8574.write(6, bitRead(buttonReg, 2));
      
      // method 2:  directly read just one button and directly set the target relay
        pcf8574.write(7, pcf8574.read(3));
        pcf8574.write(6, pcf8574.read(2));
        }
      
      //---- interrupt service routine ------------
        void buttonISR() {
        buttonPressed = true;
        }
        
      //------------------------------ End pgm -------------------------------------  
      
      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      Hello

      a little more information on the PCF8574 based material

      obsolete industrial equipment recovered in a trash can.
      system building controller from "Johnson Control" the "metasys" game
      https://cgproducts.johnsoncontrols.com/MET_PDF/6364040.PDF

      why the choice of this hardware base ?
      The Opto coupler !

      XP9104

      if not for the Arduino sketch, and its functionning with the PCF8574 library from RobT it's functional 🙂

      as soon as I activate
      #define MY_TRANSPORT_WAIT_READY_MS 3000
      it works, why it works 😞

      Thank you jkandasa for your curiosity, yes the fact that I dive back into it there was like a spark inter neuronal 🙂

      Thanks

      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      well, here we are, we think we are alone in the world, but no 🙂

      thank you skywatch

      they is or my sketch that I answer to jkandasa

      posted in Hardware
      JeeLet
      JeeLet
    • RE: MyS blocking i2c PCF8574

      Hello jkandasa

      I will have to find my skecth in my sketch box 🙂

      but in the meantime I have a problem to solve, very serious

      I can't connect to the MyController forum. 😞
      it happened after I cleared my browser cache

      I have recreated a new password but nothing, I don't have the hands.

      This sentence is thrown in my face:

      Login failed
      We cannot connect you, probably because your session has expired. Please try again.

      even creating a new account is impossible

      thank you

      posted in Hardware
      JeeLet
      JeeLet
    • MyS blocking i2c PCF8574

      Hello

      good news, the libraries for PCF8574 are not compatible with MySensors, one less thing to manage. 🙂

      I have been testing for a week the different version of library found on the web, it works well, but when I insert the bases of the sketch for MySensors the i2C communication is blocked, and the PCF8574 remains the four iron in the air.

      even with the super https://github.com/RobTillaart/PCF8574

      I've been looking for a practical expander and MySensors on the web, but nothing.

      So everything is normal??? 😞

      posted in Hardware
      JeeLet
      JeeLet
    • RE: 💬 Building a wired RS485 sensor network

      yes it's not easy, the loss of package is a difficult thing to
      to counter, but not entirely.
      and the multiple layers of a computer system do not help 🙂

      some philosophy on collision avoidance
      https://arduino.stackexchange.com/questions/24523/rs485-multimaster-communication-with-collision-avoidance

      don't mix the Protocol (data encapsulation)
      and the physical support (voltage frequency impendance / star or serial bus)

      the ModBus protocol on a RS485 support
      https://www.electroniclinic.com/arduino-modbus-rs485-arduino-rs485-master-and-slave/

      a different explanation https://www.codrey.com/learn/rs-485-arduino-quick-primer/

      for information
      https://github.com/sonyarouje/Arduino_HardwareSerial_RS485

      But the best solution (reliability and especially lightness of the sketch) is the CAN bus 🙂

      I may have said some stupid things 😉

      Translated with www.DeepL.com/Translator (free version)

      posted in Announcements
      JeeLet
      JeeLet
    • RE: Where did everyone go?

      Yes MySensors must continue, and it continues to live 🙂
      it's a system open to all possible modifications.

      an economical system, not obsolete in 1 years, not polluting Hertzian and reliable with the implementation of field bus (Rs485 - CAN)

      why such a madness of technology to tell me that in my living room it is 20°C or that my front door is open?

      a web server for a temperature sensor is nonsense.

      Yes to the Minimalist System 🙂

      Faithful reader of Elektor since the number 1, I see the technological progression
      which leads us to our loss.

      IoT objects on LoRaWan still a polluting thing*.

      ByBye

      • waste / health / freedom

      Translated with www.DeepL.com/Translator (free version)

      posted in General Discussion
      JeeLet
      JeeLet
    • RE: Fields Mysensors

      can be the good solution to put everything back to MyController

      without doing anything 🙂

       bool info;
      
      Void setup  {......
        //info send to gateway
         send(msg.set(info)); 
         send(msgx.set(info)); //pour d'autres  
      ...}
      

      to be seen later

      posted in MyController.org
      JeeLet
      JeeLet
    • RE: Fields Mysensors

      exit status 1 : 'value' was not declared in this scope

      but why in the setup ?
      you have to put it in Loop () ?

      //-----------Mars.2022------- Node 32 --------- MySensors DI DO MyController -----------------//
        // #define MY_DEBUG                  /*Enable debug prints to serial monitor*/
        //  #define   MY_DEBUG_OTA_DISABLE_ECHO  //envoyer des messages sans demander à la destination de renvoyer le message
      // Mysensors advanced settings
        //  #define MY_TRANSPORT_WAIT_READY_MS 3000 /*Tempo d'attente de mis en Com, des millisecondes - à placer avant Mysensors.h*/ 
        //  #define  MY_SPLASH_SCREEN_DISABLED /*désactive écran de démarrage MySensors (économie 120oct. en flash)*/
       
          #define MY_NODE_ID 32                   /*Node en ID static*/
        
      /* ----- Module TTL-RS485 ----*/
        #define MY_RS485                  /*Apl du transport RS485 (protocol?)*/
        #define MY_RS485_DE_PIN 2         /*Cmd DE pin*/
        #define MY_RS485_BAUD_RATE 9600   /*Set RS485 baud rate to use*/
        #define MY_REPEATER_FEATURE       /*Activer fonctionnalité de répéteur du nœud*/
        
        #include <MySensors.h>
        #include <Bounce2.h>
      
      // ------ objet ------
        #define RELAY_PIN   7    /*Pin Relay-DO*/
        #define BBUTTON_PIN 6    /*Pin boton-DI*/
        
        #define CHILD_ID_R 3    /*Id du Relay*/
        #define CHILD_ID_B 4    /*Id du bouton poussoir*/
      
        #define RELAY_ON 1
        #define RELAY_OFF 0   
      
      //----- Instancier objet Bounce ------
          Bounce debouncer = Bounce(); 
          int oldValue=0;
          
          bool state;
         
      // ------ Mysensors -------
      
        MyMessage msg(CHILD_ID_R,V_STATUS);   /*Relay*/
        MyMessage msg1(CHILD_ID_B,V_TRIPPED);  /*Boton*/
      
       void setup()  {
      
          pinMode (RELAY_PIN,OUTPUT);         /*config pin relay*/
          digitalWrite(RELAY_PIN, RELAY_OFF); /*désactive Relay au démarrage*/ 
      
          pinMode(BBUTTON_PIN,INPUT_PULLUP) ;   /*Configure Pin en input et Active pull-up interne*/
          debouncer.attach(BBUTTON_PIN);        /*configurez l'instance Bounce*/
          debouncer.interval(5);                /*interval in ms*/    
      
       //  send(msg.set(value==HIGH ? 1 : 0));      /*Relay 
        }
      
       void presentation() {
        sendSketchInfo("DiDo node 32", "2.0");  /*info version sketch à la passerelle*/
      
      /*Mysenors Enregistre Child and Gw*/
        present(CHILD_ID_R, S_BINARY);    /*Relay*/
        present(CHILD_ID_B, S_DOOR);      /*Boton*/  
        
      /* requetes/demandes à un noeud ou GW une variable*/
        request(CHILD_ID_R, V_STATUS);   /*Relay*/
        request(CHILD_ID_B, V_STATUS);  /*Boton*/  
       }
      
       void loop()  {
      
      /*Vérifie un changement d'etat sur les entrées numérique et envoye la nouvelle valeur*/
          debouncer.update();             /*Update the Bounce instances*/
          int value = debouncer.read();   /*Get the updated value*/
      
      /*Relay*/
      //    if (valueR != oldValueR) {   
      //    send(msg.set(valueR==HIGH ? 1 : 0));   /*Envoyer la nouvelle valeur*/
      //    Serial.println ("Changement d'etat bouton A");
      //    oldValueR = valueR;
      //    }
        
      /*bouton*/
          if (value != oldValue) {
           send(msg1.set(value==HIGH ? 1 : 0));    // Envoyer la nouvelle valeur
           Serial.println ("Changement d'etat bouton ");
           oldValue = value;
          }
       }
       
        void receive(const MyMessage &message) {
        // attente qu'un seul type de message du contrôleur , vérifier.
          if (message.isAck()) {
          Serial.println("Ceci est un accusé de réception de la passerelle");
          }
        
          if (message.type == V_STATUS) //V_STATUS ancien V_LIGHT
          {
          state = message.getBool ();
          digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);  // Changer l'état du relais
      
      //if (message.getType()==V_STATUS) {
          // Change relay state
        //  digitalWrite(message.getSensor() - RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF);
         
        } 
        
       }
      // -------------------- END PGM --------------------------- 
      
      posted in MyController.org
      JeeLet
      JeeLet
    • RE: Fields Mysensors

      Hello jkandasa

      I spent the day on the Mysensors website copying/translating some parts of the "serial_api_20" doc
      (I have no more eyes 🙂 )

      yes I will add it soon
      send(msg.set(value==HIGH ? 1 : 0)); // Relay

      you mas understood, I try to write well the code of the sckech
      so that MyCrontroller goes up cleanly the sensors 🙂

      Merci

      posted in MyController.org
      JeeLet
      JeeLet
    • RE: Fields Mysensors

      Hello
      a tutorial / help for the structure
      (the skeleton) of a MySensors sketch.

      to go back automatically to MyController
      the nodes and sensors

      here is an example in image (pdf)
      texte du lien

      and the sketch (Mysensors parts only )

      // ------ Mysensors V2 ------- //
      
        #define MY_NODE_ID 32   /*Node ID static*/
        #define CHILD_ID_R 3    /*Id  Relay*/
        #define CHILD_ID_B 4    /*Id  Door*/
          
        MyMessage msg(CHILD_ID_R,V_STATUS);  
        MyMessage msg1(CHILD_ID_B,V_TRIPPED);  
      
        void setup() { .... }
      
        void presentation()   {
        sendSketchInfo("DiDo node 32", "2.0");  /* version sketch*/
      
      //Mysenors save Child and Gw
        present(CHILD_ID_R, S_BINARY);  /*output digital*/
        present(CHILD_ID_B, S_DOOR);    /*input digital*/  
      
        request(CHILD_ID_R, V_STATUS);    /*request value of the controller*/
        request(CHILD_ID_B, V_STATUS); 
      ... }
      
       void loop()  { ...
             
      //  send(msg.set(value==HIGH ? 1 : 0));      /*Relay 
          send(msg1.set(value==HIGH ? 1 : 0));     /*Door 
      ...}
        
      void receive(const MyMessage &message)  {
      
         if (message.type == V_STATUS) 
         {
         state = message.getBool ();
         digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);  /*Change relay state*/
      
         if (message.getType()==V_STATUS) 
         {
         //digitalWrite(message.getSensor() - RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF);
      ... }
      
      

      a question : I don't understand the use of
      "message.getType" and "message.getBool" ?

      one instruction too many ??

      thanks

      posted in MyController.org
      JeeLet
      JeeLet
    • French Version

      French version of mycontroller has just arrived 🙂

      https://forum.mycontroller.org/topic/68/french/12

      version 2 continues its evolution, quietly but surely

      MyController ? super light and super fast.

      https://v2.mycontroller.org/docs/overview/architecture/

      posted in MyController.org
      JeeLet
      JeeLet
    • Widgets météo

      Hello

      you can do many things with MyController

      Here is an example of an animated weather map, gif image.
      text alternatif

      I tested the end of the connection of the page, after closing the widgets, the dashboard, there is no more web access, I don't like too much the stuff that works behind my back 🙂

      in short, what happiness

      posted in MyController.org
      JeeLet
      JeeLet
    • RE: Fields Mysensors

      I found it 😉

      in Resource Filters

      Key : sourceid
      Value : 2

      (I update my pdf)

      yeah the doc on the use of
      "Resource Filters" with "Key" "Value"
      values would be nice

      it's really a pity that you can't modify your previous post, too short delay, minimum one month 🙂

      posted in MyController.org
      JeeLet
      JeeLet
    • Fields Mysensors

      Hello
      discovering MyController2
      I'm trying to understand how to get the data back
      of Mysensors in the dashboard.

      the question is :
      how to differentiate my sensors in the Widgets?

      in the example of the pdf file https://nsmf01.casimages.com/f/2022/03/24//2203240203102387089992.pdf
      I have two V_TEMP and two V_HUM

      a test by renaming Name :V_TEMP to V_TEMP1 gave nothing, TEMP1 comes back as TEMP

      in short it is the fog

      how do we use the labels?
      I didn't find any doc on the subject with Mysensors

      Thanks

      posted in MyController.org
      JeeLet
      JeeLet
    • RE: Mysensors et dual Bus

      view
      Thank you for the link
      I'll head in that direction
      feedback after testing

      posted in Jeedom
      JeeLet
      JeeLet
    • Mysensors et dual Bus

      Hello

      text alternatif

      a request for the possibility of a double bus .
      a wired connection (rs485) and a wireless connection.

      is this possible with Mysensors ??

      Thank you

      posted in Jeedom
      JeeLet
      JeeLet
    • Domoticz no Update

      Hello
      The Domoticz Controller is no longer up to date since Version 1.5 of MySensors
      the Bug with dual DHT Sensors is still not resolved

      the Yes in the table of S_TEMP and HUM is False
      https://www.mysensors.org/controller

      many requests
      https://easydomoticz.com/forum/viewtopic.php?t=7386

      Bybye

      posted in Domoticz
      JeeLet
      JeeLet
    • States Relay

      translate French--> Anglais

      Hello
      a request on the Eternal "status feedback" of a command.

      did the command activate my request?
      a can like an existential, to be or not to be

      My test model diagram
      Domoticz ----> Arduino output ----> Relay
      Domoticz <----- Arduino Input <----- °--°

      the scheme
      alt text

      a skit tampering

      /*
      *
       * compilation de 
       *  RelayActuator.ino et BinarySwitchSensor.ino
       *
       * LA DESCRIPTION
       * utilisation d'un contact auxilaire du relais pour retour d'etat d'une commande, 
       *
       *
       */
      
      
      //----------------------- Library Configuration ---------------------
       #define MY_DEBUG                          // uncomment to enable debug prints to serial monitor
      
       #define MY_NODE_ID 22                   /*Node en ID static*/
       
       #define MY_TRANSPORT_WAIT_READY_MS 3000 /*Tempo d'attente de mis en Com, des millisecondes*/ 
       #define  MY_SPLASH_SCREEN_DISABLED /*désactive écran de démarrage MySensors (économie 120oct. en flash)*/
      
      //-------------------------------Bus RS485--------------------------------
       #define MY_RS485       
       #define MY_RS485_DE_PIN 2
       #define MY_RS485_BAUD_RATE22 9600  /* débit du bus rs485*/
       // #define MY_RS485_HWSERIAL Serial1    /*pour Mega2560,Serial 1-2- ou 3 ? */
      
      //---------------------------------------------------------------------------
      
      #include <MySensors.h>
      #include <Bounce2.h>  /*anti rebond*/
      
      #define CHILD_ID 3 // contact enfant
      
      //--------------- contact-----------------------
      #define BUTTON_PIN  7   // Broche Arduino Digital I / O pour bouton / interrupteur reed
      
      //------------------ relay------------------------------
      #define RELAY_PIN 3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 1 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      //----------------- contact
      //Bounce debouncer = Bounce(); 
      //int oldValue=-1;
      
      Bounce debouncer = Bounce(); 
      int oldValue=0;
      bool state;
      
      // -----------------contact--------------------
      
      MyMessage msg(CHILD_ID,V_TRIPPED);  // V_LIGHT si vous utilisez S_LIGHT
      
      //MyMessage msg(CHILD_ID,V_LIGHT); 
      
      //-------------------- Relay--------------------------------
      //void before()
      //{
      //    for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
      //        pinMode(pin, OUTPUT);  // Then set relay pins in output mode
              // Set relay to last known state (using eeprom storage)
              //digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
      //    }
      //}
      //----------------------  *************-----------------------------------
      
      void setup()  
      {  
        // Configurer le bouton
        pinMode(BUTTON_PIN,INPUT_PULLUP);
        digitalWrite(BUTTON_PIN,HIGH);
        
        // configure le bouton et debounce
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
      
       // Assurez-vous que les relais sont désactivés au démarrage 
        digitalWrite(RELAY_PIN, RELAY_OFF);
        // Réglez ensuite les broches de relais en mode sortie 
        pinMode(RELAY_PIN, OUTPUT);     
        
      }
      
      void presentation()
        {
       //------------------ contact-----------------   
        // pouvez utiliser S_DOOR, S_MOTION ou S_LIGHT,  Si S_LIGHT est utilisé, 
        //n'oubliez pas de mettre à jour le type de variable que vous envoyez. Voir "msg" ci-dessus.
       // present(CHILD_ID, S_DOOR);  
        //----------------- ************----------------
      present(CHILD_ID, S_LIGHT);
        //-------------------- relay ---------------------------------------
            sendSketchInfo("Relay et State", "2.0");
      
          for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++)
          {
           present(sensor, S_BINARY);  // Register et  created as child devices
          }
       //--------------------****************-------------------------   
      }
      
      void loop() 
      {
      //      --------------- contact--------------  
        debouncer.update(); // control Etat contact 
        int value = debouncer.read(); // Récupère la valeur de mise à jour
      //-----------------------------
        if (value != oldValue && value==0) {
            send(msg.set(state?false:true), true); // Envoyer un nouvel état et demander un accusé de réception
        }
        oldValue = value;
      } 
      
      //------------------------------------------ 
      //  if (value != oldValue)  // Envoyer la nouvelle valeur
      //  {
      //     send(msg.set(value==HIGH ? 1 : 0));
      //     oldValue = value;
      //  }
      //} 
      //-----------------------------
      
      //  --------------------************-------------------  
      
      // -------------------- Relay-----------------------
      void receive(const MyMessage &message)
      {
      
      if (message.isAck()) {
           Serial.println("This is an ack from gateway");
        }
        
          // We only expect one type of message from controller. But we better check anyway.
         // if (message.getType()==V_STATUS) {
              // Change relay state
                   // digitalWrite(message.getSensor()-1+RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF);
                  
            
      //-----------------cmd local----------------
       if (message.type == V_LIGHT) {
           // Change relay state
           state = message.getBool();
           digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
              
      //-------------------------------------------        
              // Write some debug info
              Serial.print("    Incoming change for sensor:");
              Serial.println(message.getSensor());
              Serial.print("   New status: ");
              Serial.println(message.getBool());
      
              Serial.print(" etat contact ");
              Serial.println(oldValue);
              }
      }
      
      // ----------------- fin Pgm -----------------
      

      already made a request on
      but no answer. https://easydomoticz.com/forum/viewtopic.php?f=20&t=10601

      so how to activate the relay state in Domoticz

      Thank you

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      Yes errors on the commands given through domoticz
      only one in three and taken into account

      terminal copy serial

      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 1
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 1
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 0
      

      ...and the local push button commands are not taken into account

      in the loop something that dies its tail ??

         // Inform controller if state change from input
          if (debouncer.update()) 
          {
              bool newState = !digitalRead(CONTROL_INPUT_PIN);
              if (newState != currentState)
              {
                  currentState = newState;
                  if (currentState != controllerState)
                  {
                      send(msg.set(currentState));
                  }
              }
          }
      

      merci Boum

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      @boum said in Domoticz/Mysensors:

      First, you probably should have started another thread rather than hijacking this one since the situation is barely related.

      Hello
      I just saw your message.
      nothing seen in my mailbox.

      yes that's true for another post, but the quest has the same 🙂
      to see if moderator or alco finds useful, is to do so.

      Thanks for paying attention to my problem, cool.

      I tested the sketch and the errors "MCO: PRO: RC" its part .... bingo

      but as nature hates emptiness, something else happens (nothing serious)

      .... a story of disregard for a local change / command / switchover of the TL

      I look better at your modifications to understand the arduino.
      thank you for the comments in the scketch

      my test model
      alt text

      Well!! where is the notifications button

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      ...I forgot the terminal debug

      .```
      ...set to OFF
      Changement entrant pour le capteur:3, New status: 0
      36376 TSF:MSG:SEND,24-24-0-0,s=3,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:0
      44859 TSF:MSG:READ,0-0-24,s=3,c=1,t=2,pt=0,l=1,sg=0:1
      44864 TSF:MSG:ECHO REQ
      44883 TSF:MSG:SEND,24-24-0-0,s=3,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=OK:1
      44890 !MCO:PRO:RC=1
      5080 !MCO:PRO:RC=1

      ....set to ON
      5080 !MCO:PRO:RC=1
      45082 !MCO:PRO:RC=1
      45084 !MCO:PRO:RC=1
      45086 !MCO:PRO:RC=1
      45088 !MCO:PRO:RC=1
      Changement entrant pour le capteur:3, New status: 1
      45127 TSF:MSG:SEND,24-24-0-0,s=3,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:1

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      hello, am french.

      no answer from Alco ??

      I simplify the code to understand how it works

      and put the diagram too

      alt text

      code:

      /*
      *  Alco_TL_Impuls_Light.ino
      *
      * https://forum.mysensors.org/topic/11263/domoticz-mysensors
      *
      *
      * REVISION HISTORY
      * Version 1.0 - Gateway Serial par Alco 
      * Version 0.0 - Node en RS485 par JeeLet
      * 
      *LA DESCRIPTION 
        * TL :Commande Impulsionnelle de TeLerupteur d'Eclairage 
        * TS :Retour d'Etat par un contact auxilaire du TL. 
        * 
        * L'installation Electrique n'est pas modifier, 
        * les bouton poussoir de l'habitat Cmd aussi le TL. 
        *  
        *  
        */ 
      
      //#define MY_DEBUG
      #define MY_NODE_ID 24           /*pour Node ID static*/
      
      /* ----- Module RS485 ----*/
       #define MY_RS485
       #define MY_RS485_DE_PIN 2
       #define MY_RS485_BAUD_RATE 9600
      // #define MY_RS485_HWSERIAL Serial1 /* Mega2560, port Serial X? */
      
      #include <MySensors.h>
      #include <Bounce2.h>
      
      #define CHILD_ID 3   /*Id du capteur (enfant)*/
      
      #define RELAY_PIN  4   // pin Cmd Telerupteur     "TL"
      #define BUTTON_PIN  3  // pin Contact Auxiliaire  "TS"
      
      #define RELAY_ON 1 
      #define RELAY_OFF 0
      
      Bounce debouncer = Bounce();  // initialize debouncer
      
      MyMessage msg(CHILD_ID,V_STATUS);
      
      void setup()
        {
        pinMode(BUTTON_PIN,INPUT_PULLUP);
        pinMode(RELAY_PIN , OUTPUT);
        digitalWrite(RELAY_PIN, RELAY_OFF);
        
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(20); // minimum ?
        }
      
        bool state;
        boolean inputState;
      
      void presentation()
        {
        sendSketchInfo("Cmd TL", "1.a");
        present(BUTTON_PIN, S_LIGHT);
        }
      
      void loop()
        {
        if (debouncer.update()) 
         {
         inputState =! digitalRead(BUTTON_PIN);
         send(msg.set(inputState));
         }
        }
      
      void receive(const MyMessage &message)
        {
        if (message.isAck())
          {
           Serial.println("Ceci est un accusé de réception de la passerelle");
           Serial.println("Cmd TL 1.a");
          }
        if (message.type==V_STATUS) // V_STATUS pour MyS v2.0, annulé V_LIGHT. 
          {    
            //if (state = message.getBool () == true) {          
              //  state = message.getBool();
           
           digitalWrite(RELAY_PIN, RELAY_ON);
           wait(200);                          //delai On-Off Impuls
           digitalWrite(RELAY_PIN, RELAY_OFF);
          }
          
      // Write some debug info
         Serial.print("Changement entrant pour le capteur:");
         Serial.print(message.sensor);
         Serial.print(", New status: ");
         Serial.println(message.getBool());
         // }
        }
      // ------------ fin Pgm -----------
      

      the code is not good,dialogue errors :

      error on domoticz
      Error sending switch command, check device/hardware (idx=8) !

      Log:
      Error: MySensors: Repeating previous command (2/2)
      Error: MySensors: Command not received by Node !! (node_id: 24, child_id: 3)

      ??????

      thank you

      posted in Domoticz
      JeeLet
      JeeLet