Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
M

MCF

@MCF
About
Posts
33
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • I can't download mysensors sketch with a raspberry pi3
    M MCF

    I havent' seen but some one had the same probleme on the forum, and found the solution:
    [link text]
    https://forum.mysensors.org/topic/6096/problem-with-mysensor-library-on-arduino-ide-running-on-raspi/8

    now i can download my sketch with the raspberry pi and i'm very hapy!

    General Discussion

  • I can't download mysensors sketch with a raspberry pi3
    M MCF

    Hi,
    I juste bought a rp3, and i wanted to try to install arduino IDE on it. When that was done, i had to fight against the beast to add the mysensors library (arduino 2:1.0.5+dfsg2-4-1).
    It's unusual for my, because ther is no library manager with that arduino ide version.
    Any way, i tryed next to dowload a sketch (working fine with windows), and i had a lot of strange message like that:

    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:321:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/drivers/RF24/RF24.cpp: In function ‘void RF24_csn(bool)’:
    /home/pi/sketchbook/libraries/MySensors/drivers/RF24/RF24.cpp:46:38: error: ‘hwDigitalWrite’ was not declared in this scope
      hwDigitalWrite(MY_RF24_CS_PIN, level);
                                          ^
    /home/pi/sketchbook/libraries/MySensors/drivers/RF24/RF24.cpp: In function ‘void RF24_ce(bool)’:
    /home/pi/sketchbook/libraries/MySensors/drivers/RF24/RF24.cpp:51:38: error: ‘hwDigitalWrite’ was not declared in this scope
      hwDigitalWrite(MY_RF24_CE_PIN, level);
                                          ^
    /home/pi/sketchbook/libraries/MySensors/drivers/RF24/RF24.cpp: In function ‘bool RF24_initialize()’:
    /home/pi/sketchbook/libraries/MySensors/drivers/RF24/RF24.cpp:459:34: error: ‘hwPinMode’ was not declared in this scope
      hwPinMode(MY_RF24_CE_PIN, OUTPUT);
                                      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void stInitTransition()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:94:45: error: ‘hwReadConfigBlock’ was not declared in this scope
                        sizeof(transportConfig_t));
                                                 ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void stInitUpdate()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:124:45: error: expected ‘)’ before ‘PRIu8’
        TRANSPORT_DEBUG(PSTR("TSM:INIT:STATID=%" PRIu8 "\n"),(uint8_t)MY_NODE_ID);
                                                 ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:124:4: note: in expansion of macro ‘TRANSPORT_DEBUG’
        TRANSPORT_DEBUG(PSTR("TSM:INIT:STATID=%" PRIu8 "\n"),(uint8_t)MY_NODE_ID);
        ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:128:61: error: ‘hwWriteConfig’ was not declared in this scope
        hwWriteConfig(EEPROM_NODE_ID_ADDRESS, (uint8_t)MY_NODE_ID);
                                                                 ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void stIDTransition()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:209:40: error: ‘hwMillis’ was not declared in this scope
       _transportToken = (uint8_t)(hwMillis() & 0xFF);
                                            ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void stUplinkUpdate()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:261:43: error: ‘hwMillis’ was not declared in this scope
       _transportSM.lastUplinkCheck = hwMillis();
                                               ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:265:44: error: expected ‘)’ before ‘PRIu8’
        TRANSPORT_DEBUG(PSTR("TSM:UPL:DGWC,O=%" PRIu8 ",N=%" PRIu8 "\n"), _transportConfig.distanceGW,
                                                ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:265:4: note: in expansion of macro ‘TRANSPORT_DEBUG’
        TRANSPORT_DEBUG(PSTR("TSM:UPL:DGWC,O=%" PRIu8 ",N=%" PRIu8 "\n"), _transportConfig.distanceGW,
        ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void stReadyTransition()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:292:40: error: expected ‘)’ before ‘PRIu8’
      TRANSPORT_DEBUG(PSTR("TSM:READY:ID=%" PRIu8 ",PAR=%" PRIu8 ",DIS=%" PRIu8 "\n"),
                                            ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:292:2: note: in expansion of macro ‘TRANSPORT_DEBUG’
      TRANSPORT_DEBUG(PSTR("TSM:READY:ID=%" PRIu8 ",PAR=%" PRIu8 ",DIS=%" PRIu8 "\n"),
      ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void stFailureTransition()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:342:40: error: expected ‘)’ before ‘PRIu8’
      TRANSPORT_DEBUG(PSTR("TSM:FAIL:CNT=%" PRIu8 "\n"),_transportSM.failureCounter);
                                            ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:342:2: note: in expansion of macro ‘TRANSPORT_DEBUG’
      TRANSPORT_DEBUG(PSTR("TSM:FAIL:CNT=%" PRIu8 "\n"),_transportSM.failureCounter);
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void transportSwitchSM(transportState_t&)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:373:37: error: ‘hwMillis’ was not declared in this scope
      _transportSM.stateEnter = hwMillis(); // save time
                                         ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘uint32_t transportTimeInState()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:378:18: error: ‘hwMillis’ was not declared in this scope
      return hwMillis() - _transportSM.stateEnter;
                      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘bool transportWaitUntilReady(uint32_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:449:38: error: expected ‘)’ before ‘PRIu32’
      TRANSPORT_DEBUG(PSTR("TSF:WUR:MS=%" PRIu32 "\n"), waitingMS); // timeout
                                          ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:449:2: note: in expansion of macro ‘TRANSPORT_DEBUG’
      TRANSPORT_DEBUG(PSTR("TSF:WUR:MS=%" PRIu32 "\n"), waitingMS); // timeout
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:450:30: error: ‘hwMillis’ was not declared in this scope
      uint32_t enterMS = hwMillis();
                                  ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘bool transportCheckUplink(bool)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:472:26: error: ‘hwMillis’ was not declared in this scope
      if (!force && (hwMillis() - _transportSM.lastUplinkCheck) < MY_TRANSPORT_CHKUPL_INTERVAL_MS) {
                              ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:481:43: error: ‘hwMillis’ was not declared in this scope
       _transportSM.lastUplinkCheck = hwMillis();
                                               ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:485:44: error: expected ‘)’ before ‘PRIu8’
        TRANSPORT_DEBUG(PSTR("TSF:CKU:DGWC,O=%" PRIu8 ",N=%" PRIu8 "\n"), _transportConfig.distanceGW,
                                                ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:485:4: note: in expansion of macro ‘TRANSPORT_DEBUG’
        TRANSPORT_DEBUG(PSTR("TSF:CKU:DGWC,O=%" PRIu8 ",N=%" PRIu8 "\n"), _transportConfig.distanceGW,
        ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘bool transportAssignNodeID(uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:503:50: error: ‘hwWriteConfig’ was not declared in this scope
       hwWriteConfig(EEPROM_NODE_ID_ADDRESS, newNodeId);
                                                      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:504:42: error: expected ‘)’ before ‘PRIu8’
       TRANSPORT_DEBUG(PSTR("TSF:SID:OK,ID=%" PRIu8 "\n"),newNodeId); // Node ID assigned
                                              ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:504:3: note: in expansion of macro ‘TRANSPORT_DEBUG’
       TRANSPORT_DEBUG(PSTR("TSF:SID:OK,ID=%" PRIu8 "\n"),newNodeId); // Node ID assigned
       ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:507:45: error: expected ‘)’ before ‘PRIu8’
       TRANSPORT_DEBUG(PSTR("!TSF:SID:FAIL,ID=%" PRIu8 "\n"),newNodeId); // ID is invalid, cannot assign ID
                                                 ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:507:3: note: in expansion of macro ‘TRANSPORT_DEBUG’
       TRANSPORT_DEBUG(PSTR("!TSF:SID:FAIL,ID=%" PRIu8 "\n"),newNodeId); // ID is invalid, cannot assign ID
       ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘bool transportWait(uint32_t, uint8_t, uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:596:36: error: ‘hwMillis’ was not declared in this scope
      const uint32_t enterMS = hwMillis();
                                        ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘uint8_t transportPingNode(uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:612:44: error: expected ‘)’ before ‘PRIu8’
       TRANSPORT_DEBUG(PSTR("TSF:PNG:SEND,TO=%" PRIu8 "\n"), targetId);
                                                ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:612:3: note: in expansion of macro ‘TRANSPORT_DEBUG’
       TRANSPORT_DEBUG(PSTR("TSF:PNG:SEND,TO=%" PRIu8 "\n"), targetId);
       ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void transportProcessMessage()’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:660:40: error: expected ‘)’ before ‘PRIu8’
      TRANSPORT_DEBUG(PSTR("TSF:MSG:READ,%" PRIu8 "-%" PRIu8 "-%" PRIu8 ",s=%" PRIu8 ",c=%" PRIu8 ",t=%"
                                            ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:660:2: note: in expansion of macro ‘TRANSPORT_DEBUG’
      TRANSPORT_DEBUG(PSTR("TSF:MSG:READ,%" PRIu8 "-%" PRIu8 "-%" PRIu8 ",s=%" PRIu8 ",c=%" PRIu8 ",t=%"
      ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:669:41: error: expected ‘)’ before ‘PRIu8’
       TRANSPORT_DEBUG(PSTR("!TSF:MSG:LEN,%" PRIu8 "!=%" PRIu8 "\n"), payloadLength,
                                             ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:669:3: note: in expansion of macro ‘TRANSPORT_DEBUG’
       TRANSPORT_DEBUG(PSTR("!TSF:MSG:LEN,%" PRIu8 "!=%" PRIu8 "\n"), payloadLength,
       ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:677:42: error: expected ‘)’ before ‘PRIu8’
       TRANSPORT_DEBUG(PSTR("!TSF:MSG:PVER,%" PRIu8 "!=%" PRIu8 "\n"), mGetVersion(_msg),
                                              ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:677:3: note: in expansion of macro ‘TRANSPORT_DEBUG’
       TRANSPORT_DEBUG(PSTR("!TSF:MSG:PVER,%" PRIu8 "!=%" PRIu8 "\n"), mGetVersion(_msg),
       ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:762:53: error: expected ‘)’ before ‘PRIu8’
             TRANSPORT_DEBUG(PSTR("TSF:MSG:FPAR OK,ID=%" PRIu8 ",D=%" PRIu8 "\n"), _transportConfig.parentNodeId,
                                                         ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:762:9: note: in expansion of macro ‘TRANSPORT_DEBUG’
             TRANSPORT_DEBUG(PSTR("TSF:MSG:FPAR OK,ID=%" PRIu8 ",D=%" PRIu8 "\n"), _transportConfig.parentNodeId,
             ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:775:49: error: expected ‘)’ before ‘PRIu8’
          TRANSPORT_DEBUG(PSTR("TSF:MSG:PINGED,ID=%" PRIu8 ",HP=%" PRIu8 "\n"), sender,
                                                     ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:775:6: note: in expansion of macro ‘TRANSPORT_DEBUG’
          TRANSPORT_DEBUG(PSTR("TSF:MSG:PINGED,ID=%" PRIu8 ",HP=%" PRIu8 "\n"), sender,
          ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:789:53: error: expected ‘)’ before ‘PRIu8’
           TRANSPORT_DEBUG(PSTR("TSF:MSG:PONG RECV,HP=%" PRIu8 "\n"),
                                                         ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:789:7: note: in expansion of macro ‘TRANSPORT_DEBUG’
           TRANSPORT_DEBUG(PSTR("TSF:MSG:PONG RECV,HP=%" PRIu8 "\n"),
           ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:881:21: error: ‘hwMillis’ was not declared in this scope
          delay(hwMillis() & 0x3ff);
                         ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘bool transportSendWrite(uint8_t, MyMessage&)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:1001:42: error: expected ‘)’ before ‘PRIu8’
      TRANSPORT_DEBUG(PSTR("%sTSF:MSG:SEND,%" PRIu8 "-%" PRIu8 "-%" PRIu8 "-%" PRIu8 ",s=%" PRIu8 ",c=%"
                                              ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:1001:2: note: in expansion of macro ‘TRANSPORT_DEBUG’
      TRANSPORT_DEBUG(PSTR("%sTSF:MSG:SEND,%" PRIu8 "-%" PRIu8 "-%" PRIu8 "-%" PRIu8 ",s=%" PRIu8 ",c=%"
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:371:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘void transportSetRoute(uint8_t, uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:1065:51: error: ‘hwWriteConfig’ was not declared in this scope
      hwWriteConfig(EEPROM_ROUTES_ADDRESS + node, route);
                                                       ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘uint8_t transportGetRoute(uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:1075:52: error: ‘hwReadConfig’ was not declared in this scope
      result = hwReadConfig(EEPROM_ROUTES_ADDRESS + node);
                                                        ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp: In function ‘int16_t transportSignalReport(char)’:
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:1174:39: error: expected ‘)’ before ‘PRIu8’
      TRANSPORT_DEBUG(PSTR("TSF:SIR:CMD=%" PRIu8 ",VAL=%" PRIu16 "\n"), reportCommand, result);
                                           ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MyTransport.cpp:1174:2: note: in expansion of macro ‘TRANSPORT_DEBUG’
      TRANSPORT_DEBUG(PSTR("TSF:SIR:CMD=%" PRIu8 ",VAL=%" PRIu16 "\n"), reportCommand, result);
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:395:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySplashScreen.cpp: In function ‘void displaySplashScreen()’:
    /home/pi/sketchbook/libraries/MySensors/core/MySplashScreen.cpp:47:4: error: ‘MY_SERIALDEVICE’ was not declared in this scope
        MY_SERIALDEVICE.print(display);
        ^
    /home/pi/sketchbook/libraries/MySensors/core/MySplashScreen.cpp:50:2: error: ‘MY_SERIALDEVICE’ was not declared in this scope
      MY_SERIALDEVICE.println(F(MYSENSORS_LIBRARY_VERSION "\n"));
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:396:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘void _begin()’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:92:18: error: ‘hwWatchdogReset’ was not declared in this scope
      hwWatchdogReset();
                      ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:98:35: error: ‘hwInit’ was not declared in this scope
      const bool hwInitResult = hwInit();
                                       ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:107:7: error: in argument to unary !
      if (!hwInitResult) {
           ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:131:46: error: ‘hwReadConfigBlock’ was not declared in this scope
                        sizeof(controllerConfig_t));
                                                  ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:140:64: error: ‘hwWriteConfig’ was not declared in this scope
      hwWriteConfig(EEPROM_PARENT_NODE_ID_ADDRESS, MY_PARENT_NODE_ID);
                                                                    ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:171:42: error: expected ‘)’ before ‘PRIu8’
      CORE_DEBUG(PSTR("MCO:BGN:INIT OK,TSP=%" PRIu8 "\n"), isTransportReady());
                                              ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:171:2: note: in expansion of macro ‘CORE_DEBUG’
      CORE_DEBUG(PSTR("MCO:BGN:INIT OK,TSP=%" PRIu8 "\n"), isTransportReady());
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:396:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘bool _processInternalMessages()’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:403:13: error: ‘hwReboot’ was not declared in this scope
        hwReboot();
                 ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:409:41: error: expected ‘)’ before ‘PRIu8’
        CORE_DEBUG(PSTR("MCO:PIM:NODE REG=%" PRIu8 "\n"), _coreConfig.nodeRegistered); // node registration
                                             ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:409:4: note: in expansion of macro ‘CORE_DEBUG’
        CORE_DEBUG(PSTR("MCO:PIM:NODE REG=%" PRIu8 "\n"), _coreConfig.nodeRegistered); // node registration
        ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:396:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:416:49: error: ‘hwWriteConfigBlock’ was not declared in this scope
                           sizeof(controllerConfig_t));
                                                     ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘void saveState(uint8_t, uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:499:54: error: ‘hwWriteConfig’ was not declared in this scope
      hwWriteConfig(EEPROM_LOCAL_CONFIG_ADDRESS+pos, value);
                                                          ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘uint8_t loadState(uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:503:53: error: ‘hwReadConfig’ was not declared in this scope
      return hwReadConfig(EEPROM_LOCAL_CONFIG_ADDRESS+pos);
                                                         ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘void wait(uint32_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:509:39: error: ‘hwMillis’ was not declared in this scope
      const uint32_t enteringMS = hwMillis();
                                           ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘bool wait(uint32_t, uint8_t, uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:517:39: error: ‘hwMillis’ was not declared in this scope
      const uint32_t enteringMS = hwMillis();
                                           ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘void doYield()’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:530:18: error: ‘hwWatchdogReset’ was not declared in this scope
      hwWatchdogReset();
                      ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:532:8: error: ‘yield’ was not declared in this scope
      yield();
            ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp: In function ‘int8_t _sleep(uint32_t, bool, uint8_t, uint8_t, uint8_t, uint8_t)’:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:542:33: error: expected ‘)’ before ‘PRIu32’
      CORE_DEBUG(PSTR("MCO:SLP:MS=%" PRIu32 ",SMS=%" PRIu8 ",I1=%" PRIu8 ",M1=%" PRIu8 ",I2=%" PRIu8
                                     ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:542:2: note: in expansion of macro ‘CORE_DEBUG’
      CORE_DEBUG(PSTR("MCO:SLP:MS=%" PRIu32 ",SMS=%" PRIu8 ",I1=%" PRIu8 ",M1=%" PRIu8 ",I2=%" PRIu8
      ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:396:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:562:42: error: ‘hwMillis’ was not declared in this scope
       const uint32_t sleepEnterMS = hwMillis();
                                              ^
    In file included from /home/pi/sketchbook/libraries/MySensors/MySensors.h:49:0,
                     from BUREAU_PARENTS.ino:68:
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:572:35: error: expected ‘)’ before ‘PRIu32’
        CORE_DEBUG(PSTR("MCO:SLP:MS=%" PRIu32 "\n"), sleepingTimeMS);
                                       ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:572:4: note: in expansion of macro ‘CORE_DEBUG’
        CORE_DEBUG(PSTR("MCO:SLP:MS=%" PRIu32 "\n"), sleepingTimeMS);
        ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:633:34: error: expected ‘)’ before ‘PRIi8’
      CORE_DEBUG(PSTR("MCO:SLP:WUP=%" PRIi8 "\n"), result); // sleep wake-up
                                      ^
    /home/pi/sketchbook/libraries/MySensors/MyConfig.h:1815:43: note: in definition of macro ‘DEBUG_OUTPUT’
     #define DEBUG_OUTPUT(x,...)  hwDebugPrint(x, ##__VA_ARGS__) //!< debug
                                               ^
    /home/pi/sketchbook/libraries/MySensors/core/MySensorsCore.cpp:633:2: note: in expansion of macro ‘CORE_DEBUG’
      CORE_DEBUG(PSTR("MCO:SLP:WUP=%" PRIi8 "\n"), result); // sleep wake-up
      ^
    
    

    i realy don't undersand so if some one had a solution ..... thanks

    General Discussion

  • Dimmer sketches - array and multiple PWM led pins
    M MCF

    @plantex i never seen that before. do you have a controler? i use domoticz and the last dimming seems to work properly. but it's right that i dont switch off my nodes when they work, i will check that.

    Development

  • gateway serial and dimmer example
    M MCF

    (if some one can explain how

    Insert Code Here
    

    works, that could be fine too... no laughs please!

    Development

  • gateway serial and dimmer example
    M MCF

    after hours (days???) of fighting against the machine (rage?), a waf dangerously low, i got a solution... it's not the most acceptable for me, BUT IT WORKS so be it! i just change the sensor ID from 1 to 100, i'm sure that no message could be send or transfert or whatever exepted the one i chose, and trust me it's good to feel the power of the light!! i hope that some one could explain how to understand every details of Mymessage.h , anyway now this is the code...```
    /**

    • The MySensors Arduino library handles the wireless radio link and protocol
    • between your home built sensors/actuators and HA controller of choice.
    • The sensors forms a self healing radio network with optional repeaters. Each
    • repeater and gateway builds a routing tables in EEPROM which keeps track of the
    • network topology allowing messages to be routed to nodes.
    • Created by Henrik Ekblad henrik.ekblad@mysensors.org
    • Copyright (C) 2013-2015 Sensnology AB
    • Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
    • Documentation: http://www.mysensors.org
    • Support Forum: http://forum.mysensors.org
    • This program is free software; you can redistribute it and/or
    • modify it under the terms of the GNU General Public License
    • version 2 as published by the Free Software Foundation.

    • DESCRIPTION
    • The ArduinoGateway prints data received from sensors on the serial link.
    • The gateway accepts input on seral which will be sent out on radio network.
    • The GW code is designed for Arduino Nano 328p / 16MHz
    • Wire connections (OPTIONAL):
      • Inclusion button should be connected between digital pin 3 and GND
      • RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
    • LEDs (OPTIONAL):
      • To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs
      • RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
      • TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
      • ERR (red) - fast blink on error during transmission error or recieve crc error

    */

    // Enable debug prints to serial monitor
    #define MY_DEBUG

    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69

    // Set LOW transmit power level as default, if you have an amplified NRF-module and
    // power your radio separately with a good regulator you can turn up PA level.
    #define MY_RF24_PA_LEVEL RF24_PA_MAX

    // Enable serial gateway
    #define MY_GATEWAY_SERIAL

    // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    #define MY_BAUD_RATE 38400
    #endif

    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE

    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP

    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN 3

    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300

    // Inverses the behavior of leds
    //#define MY_WITH_LEDS_BLINKING_INVERSE

    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN 5 // the PCB, on board LED

    #include <MySensors.h>

    #define LED_PIN 3 // Arduino pin attached to MOSFET Gate pin
    #define FADE_DELAY 10 // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim)

    static int16_t currentLevel = 0; // Current dim level...
    MyMessage dimmerMsg(100, V_DIMMER);
    MyMessage lightMsg(100, V_LIGHT);

    void setup()
    {
    // Setup locally attached sensors
    request( 100, V_DIMMER );
    }

    void presentation()
    {
    // Present locally attached sensors
    // Register the LED Dimmable Light with the gateway
    present( 100, S_DIMMER );
    }

    void loop()
    {
    // Send locally attached sensor data here
    }
    void receive(const MyMessage &message)
    {
    if (message.sensor == 100 ){

    if (message.type == V_LIGHT || message.type == V_DIMMER) {

    //  Retrieve the power or dim level from the incoming request message
    int requestedLevel = atoi( message.data );
    
    // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
    requestedLevel *= ( message.type == V_LIGHT ? 100 : 1 );
    
    // Clip incoming level to valid range of 0 to 100
    requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
    requestedLevel = requestedLevel < 0   ? 0   : requestedLevel;
    
    Serial.print( "Changing level to " );
    Serial.print( requestedLevel );
    Serial.print( ", from " );
    Serial.println( currentLevel );
    
    fadeToLevel( requestedLevel );
    
    // Inform the gateway of the current DimmableLED's SwitchPower1 and LoadLevelStatus value...
    send(lightMsg.set(currentLevel > 0));
    
    // hek comment: Is this really nessesary?
    send( dimmerMsg.set(currentLevel) );
    

    }
    }

    }

    /***

    • This method provides a graceful fade up/down effect
      */
      void fadeToLevel( int toLevel )
      {

    int delta = ( toLevel - currentLevel ) < 0 ? -1 : 1;

    while ( currentLevel != toLevel ) {
    currentLevel += delta;
    analogWrite( LED_PIN, (int)(currentLevel / 100. * 255) );
    delay( FADE_DELAY );
    }
    }

    Development

  • gateway serial and dimmer example
    M MCF

    @towme hi, this is not a hardware problem, my led stripe is two meter long, and i've checked the mofset with another sketch. The problem for the debug message is that i don't know how to open serial monitor on the gateway connected to the rpy (i use an arduino uno ), so it's hard to check debug message live

    Development

  • gateway serial and dimmer example
    M MCF

    @plantex just because it's too bad not using those outputs! but you're right, i think i 'll solder one mini pro, and that question will be over!!

    Development

  • gateway serial and dimmer example
    M MCF

    @plantex hi, my problem is to dimm led on the gateway sketch, because i need to sort messages. i can't find exemples on the forum, it would be very strange than no one did that already!

    Development

  • Dimmer sketches - array and multiple PWM led pins
    M MCF

    hi,
    this is what i use for 3 dimmers:

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - February 15, 2014 - Bruce Lacey
     * Version 1.1 - August 13, 2014 - Converted to 1.4 (hek)
     *
     * DESCRIPTION
     * This sketch provides a Dimmable LED Light using PWM and based Henrik Ekblad
     * <henrik.ekblad@gmail.com> Vera Arduino Sensor project.
     * Developed by Bruce Lacey, inspired by Hek's MySensor's example sketches.
     *
     * The circuit uses a MOSFET for Pulse-Wave-Modulation to dim the attached LED or LED strip.
     * The MOSFET Gate pin is connected to Arduino pin 3 (LED_PIN), the MOSFET Drain pin is connected
     * to the LED negative terminal and the MOSFET Source pin is connected to ground.
     *
     * This sketch is extensible to support more than one MOSFET/PWM dimmer per circuit.
     * http://www.mysensors.org/build/dimmer
     * 
     * 
     * LISTE DE POINTS:
     * D0  DISPO
     * D1  DISPO
     * D2  IRQ NRF
     * D3  LED1
     * D4  DISPO
     * D5  LED2
     * D6  LED3
     * D7  DISPO
     * D8  DISPO
     * D9  CE NRF
     * D10 CSN/CS NRF
     * D11 MOSI NRF
     * D12 MISO NRF
     * D13 SCK NRF
     * D14 DISPO
     * 
     * 
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    //#define MY_NODE_ID 153 
    
    #include <SPI.h>
    #include <MySensors.h> 
    
    #define SN "BUREAU PARENTS"
    #define SV "1.2"
    
    #define noLEDs 3
    const int LED_Pin[] = {3, 5, 6}; 
    
    #define FADE_DELAY 10  // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim)
    
    static int currentLevel1 = 0;  // Current dim level...
    static int currentLevel2 = 0;  // Current dim level...
    static int currentLevel3 = 0;  // Current dim level...
    
    MyMessage dimmer1Msg(1, V_DIMMER);
    MyMessage light1Msg(1, V_LIGHT);
    MyMessage dimmer2Msg(2, V_DIMMER);
    MyMessage light2Msg(2, V_LIGHT);
    MyMessage dimmer3Msg(3, V_DIMMER);
    MyMessage light3Msg(3, V_LIGHT);
    
    
    /***
     * Dimmable LED initialization method
     */
    void setup()  
    { 
      // LEDS
      // Pull the gateway's current dim level - restore light level upon sendor node power-up
    for (int sensor=1; sensor<=noLEDs; sensor++){
      request( sensor, V_DIMMER );
     }
    
    
    }
    
    void presentation() {
      // Register the LED Dimmable Light with the gateway
     for (int sensor=1; sensor<=noLEDs; sensor++){
     present(sensor, S_DIMMER);
     wait(2);
     }
    
      sendSketchInfo(SN, SV);
    }
    
    /***
     *  Dimmable LED main processing loop 
     */
    void loop() 
    {
    
    
    }
    
    
    
    void receive(const MyMessage &message) {
      if (message.type == V_LIGHT || message.type == V_DIMMER) {
    
        if (message.sensor == 1) {
    
         //  Retrieve the power or dim level from the incoming request message
        int requestedLevel1 = atoi( message.data );
        
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel1 *= ( message.type == V_LIGHT ? 100 : 1 );
        
        // Clip incoming level to valid range of 0 to 100
        requestedLevel1 = requestedLevel1 > 100 ? 100 : requestedLevel1;
        requestedLevel1 = requestedLevel1 < 0   ? 0   : requestedLevel1;
    
          
         fadeToLevel1( requestedLevel1, message.sensor );
        send(light1Msg.set(currentLevel1 > 0 ? 1 : 0)); 
        send(dimmer1Msg.set(currentLevel1) );}
       
        
        
         
       if (message.sensor == 2) {
       //  Retrieve the power or dim level from the incoming request message
        int requestedLevel2 = atoi( message.data );
        
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel2 *= ( message.type == V_LIGHT ? 100 : 1 );
        
        // Clip incoming level to valid range of 0 to 100
        requestedLevel2 = requestedLevel2 > 100 ? 100 : requestedLevel2;
        requestedLevel2 = requestedLevel2 < 0   ? 0   : requestedLevel2;
        
        fadeToLevel2( requestedLevel2, message.sensor );
        send(light2Msg.set(currentLevel2 > 0 ? 1 : 0));
        send(dimmer2Msg.set(currentLevel2) );}
         
        if (message.sensor == 3) {
       //  Retrieve the power or dim level from the incoming request message
        int requestedLevel3 = atoi( message.data );
        
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel3 *= ( message.type == V_LIGHT ? 100 : 1 );
        
        // Clip incoming level to valid range of 0 to 100
        requestedLevel3 = requestedLevel3 > 100 ? 100 : requestedLevel3;
        requestedLevel3 = requestedLevel3 < 0   ? 0   : requestedLevel3;
          
         fadeToLevel3( requestedLevel3, message.sensor );
        send(light3Msg.set(currentLevel3 > 0 ? 1 : 0));
        send(dimmer3Msg.set(currentLevel3) );}
        }
    
        
    }
    
    /***
     *  This method provides a graceful fade up/down effect
     */
    void fadeToLevel1( int toLevel1, int ledid1 ) {
    
      int delta1 = ( toLevel1 - currentLevel1 ) < 0 ? -1 : 1;
      
      while ( currentLevel1 != toLevel1 ) {
        currentLevel1 += delta1;
        analogWrite(LED_Pin[ledid1-1], (int)(currentLevel1 / 100. * 255) );
        wait( FADE_DELAY );
      }
    }
    void fadeToLevel2( int toLevel2, int ledid2 ) {
    
      int delta2 = ( toLevel2 - currentLevel2 ) < 0 ? -1 : 1;
      
      while ( currentLevel2 != toLevel2 ) {
        currentLevel2 += delta2;
        analogWrite(LED_Pin[ledid2-1], (int)(currentLevel2 / 100. * 255) );
        wait( FADE_DELAY );
      }
    }
    void fadeToLevel3( int toLevel3, int ledid3 ) {
    
      int delta3 = ( toLevel3 - currentLevel3 ) < 0 ? -1 : 1;
      
      while ( currentLevel3 != toLevel3 ) {
        currentLevel3 += delta3;
        analogWrite(LED_Pin[ledid3-1], (int)(currentLevel3 / 100. * 255) );
        wait( FADE_DELAY );
      }
    }
    

    it work not too bad, maybe that can help!

    Development

  • gateway serial and dimmer example
    M MCF

    @mfalkvidd hello, i'm sorry to say that, but i don't know how to do.. i try to understand how mysensors work but i really need your help!

    Development

  • 💬 Motion Sensor
    M MCF

    @gohan ok thank you for answering. if i do this:

    void loop() 
    {
      // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR)== HIGH;
        
        Serial.println("coucou");
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
        }
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    

    the node never stop to send message to the gateway. i would like to send something only if D1 goes to high, is that possible ? (i'm starting combinating exemple and i want to understand what i do now!!)

    Announcements

  • 💬 Motion Sensor
    M MCF

    this is my code

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - February 15, 2014 - Bruce Lacey
     * Version 1.1 - August 13, 2014 - Converted to 1.4 (hek)
     *
     * DESCRIPTION
     * This sketch provides a Dimmable LED Light using PWM and based Henrik Ekblad
     * <henrik.ekblad@gmail.com> Vera Arduino Sensor project.
     * Developed by Bruce Lacey, inspired by Hek's MySensor's example sketches.
     *
     * The circuit uses a MOSFET for Pulse-Wave-Modulation to dim the attached LED or LED strip.
     * The MOSFET Gate pin is connected to Arduino pin 3 (LED_PIN), the MOSFET Drain pin is connected
     * to the LED negative terminal and the MOSFET Source pin is connected to ground.
     *
     * This sketch is extensible to support more than one MOSFET/PWM dimmer per circuit.
     * http://www.mysensors.org/build/dimmer
     * 
     * 
     * LISTE DE POINTS:
     * D0  DISPO
     * D1  MOTION
     * D2  IRQ NRF
     * D3  LED1
     * D4  DISPO
     * D5  LED2
     * D6  LED3
     * D7  DISPO
     * D8  DISPO
     * D9  CE NRF
     * D10 CSN/CS NRF
     * D11 MOSI NRF
     * D12 MISO NRF
     * D13 SCK NRF
     * D14 DISPO
     * 
     * 
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    //#define MY_NODE_ID 153 
    
    #include <SPI.h>
    #include <MySensors.h> 
    
    #define SN "BUREAU PARENTS"
    #define SV "1.2"
    
    #define noLEDs 3
    const int LED_Pin[] = {3, 5, 6}; 
    
    #define FADE_DELAY 10  // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim)
    
    static int currentLevel1 = 0;  // Current dim level...
    static int currentLevel2 = 0;  // Current dim level...
    static int currentLevel3 = 0;  // Current dim level...
    
    MyMessage dimmer1Msg(1, V_DIMMER);
    MyMessage light1Msg(1, V_LIGHT);
    MyMessage dimmer2Msg(2, V_DIMMER);
    MyMessage light2Msg(2, V_LIGHT);
    MyMessage dimmer3Msg(3, V_DIMMER);
    MyMessage light3Msg(3, V_LIGHT);
    
    // MOTION SENSOR
    uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 1   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 4   // Id of the sensor child
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    /***
     * Dimmable LED initialization method
     */
    void setup()  
    { 
      // LEDS
      // Pull the gateway's current dim level - restore light level upon sendor node power-up
    for (int sensor=1; sensor<=noLEDs; sensor++){
      request( sensor, V_DIMMER );
     }
     // MOTION
     pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
    }
    
    void presentation() {
      // Register the LED Dimmable Light with the gateway
     for (int sensor=1; sensor<=noLEDs; sensor++){
     present(sensor, S_DIMMER);
     wait(2);
     }
      // MOTION
      present(CHILD_ID, S_MOTION);
      
      sendSketchInfo(SN, SV);
    }
    
    /***
     *  Dimmable LED main processing loop 
     */
    void loop() 
    {
      // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR)== HIGH;
        
        Serial.println("coucou");
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
        }
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    
    
    
    void receive(const MyMessage &message) {
      if (message.type == V_LIGHT || message.type == V_DIMMER) {
    
        if (message.sensor == 1) {
    
         //  Retrieve the power or dim level from the incoming request message
        int requestedLevel1 = atoi( message.data );
        
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel1 *= ( message.type == V_LIGHT ? 100 : 1 );
        
        // Clip incoming level to valid range of 0 to 100
        requestedLevel1 = requestedLevel1 > 100 ? 100 : requestedLevel1;
        requestedLevel1 = requestedLevel1 < 0   ? 0   : requestedLevel1;
    
          
         fadeToLevel1( requestedLevel1, message.sensor );
        send(light1Msg.set(currentLevel1 > 0 ? 1 : 0)); 
        send(dimmer1Msg.set(currentLevel1) );}
       
        
        
         
       if (message.sensor == 2) {
       //  Retrieve the power or dim level from the incoming request message
        int requestedLevel2 = atoi( message.data );
        
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel2 *= ( message.type == V_LIGHT ? 100 : 1 );
        
        // Clip incoming level to valid range of 0 to 100
        requestedLevel2 = requestedLevel2 > 100 ? 100 : requestedLevel2;
        requestedLevel2 = requestedLevel2 < 0   ? 0   : requestedLevel2;
        
        fadeToLevel2( requestedLevel2, message.sensor );
        send(light2Msg.set(currentLevel2 > 0 ? 1 : 0));
        send(dimmer2Msg.set(currentLevel2) );}
         
        if (message.sensor == 3) {
       //  Retrieve the power or dim level from the incoming request message
        int requestedLevel3 = atoi( message.data );
        
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel3 *= ( message.type == V_LIGHT ? 100 : 1 );
        
        // Clip incoming level to valid range of 0 to 100
        requestedLevel3 = requestedLevel3 > 100 ? 100 : requestedLevel3;
        requestedLevel3 = requestedLevel3 < 0   ? 0   : requestedLevel3;
          
         fadeToLevel3( requestedLevel3, message.sensor );
        send(light3Msg.set(currentLevel3 > 0 ? 1 : 0));
        send(dimmer3Msg.set(currentLevel3) );}
        }
    
        
    }
    
    /***
     *  This method provides a graceful fade up/down effect
     */
    void fadeToLevel1( int toLevel1, int ledid1 ) {
    
      int delta1 = ( toLevel1 - currentLevel1 ) < 0 ? -1 : 1;
      
      while ( currentLevel1 != toLevel1 ) {
        currentLevel1 += delta1;
        analogWrite(LED_Pin[ledid1-1], (int)(currentLevel1 / 100. * 255) );
        wait( FADE_DELAY );
      }
    }
    void fadeToLevel2( int toLevel2, int ledid2 ) {
    
      int delta2 = ( toLevel2 - currentLevel2 ) < 0 ? -1 : 1;
      
      while ( currentLevel2 != toLevel2 ) {
        currentLevel2 += delta2;
        analogWrite(LED_Pin[ledid2-1], (int)(currentLevel2 / 100. * 255) );
        wait( FADE_DELAY );
      }
    }
    void fadeToLevel3( int toLevel3, int ledid3 ) {
    
      int delta3 = ( toLevel3 - currentLevel3 ) < 0 ? -1 : 1;
      
      while ( currentLevel3 != toLevel3 ) {
        currentLevel3 += delta3;
        analogWrite(LED_Pin[ledid3-1], (int)(currentLevel3 / 100. * 255) );
        wait( FADE_DELAY );
      }
    }
    
    Announcements

  • 💬 Motion Sensor
    M MCF

    hi,
    i want to ad a motion sensor to my project (3 dimmers on a arduino uno using nrf24).
    My first problem is that the 2 and 3 pins are not available (nrf24 and pwm dimmer), so i will take the pin 1 for testing
    second is the sleeping time during i can't send any light message to my dimmers...

    Announcements

  • gateway serial and dimmer example
    M MCF

    hi, i'm still trying to understand how to drive my gateway led strip! maybe i miss to tell you that i wanted to dimm that only with my controler, which is a domoticz on a rpy. is it the same way as usual, or is there another way that sending message to the gateway because i can't understand how to do!

    Development

  • gateway serial and dimmer example
    M MCF

    so i wrote

    if (message.destination==0){
    

    and the light still doesn't work. every destination message on the network is the gateaway, right? so how can i just dim the led attached on her ? maybe i dont need to send a message?? I'm a litle bit confuzed

    Development

  • gateway serial and dimmer example
    M MCF

    @mfalkvidd thank you very much, i was searching in vain a list of the mymessage class!!!! do you know where can i find that ?

    Development

  • gateway serial and dimmer example
    M MCF

    if i write getNodeId(0), there is too many arguments. so i tryied just getNodeId().
    this doesn't work, and i think i know why: message.sensor is a child ID isn't it?

    Development

  • gateway serial and dimmer example
    M MCF

    @mfalkvidd you mean something like```
    void receive(const MyMessage &message)
    {
    if message.sensor==getNodeId(0){ //the node id of my passerelle
    if (message.type == V_LIGHT || message.type == V_DIMMER) {

    //  Retrieve the power or dim level from the incoming request message
    
    ?
    Development

  • gateway serial and dimmer example
    M MCF

    it seems to work, but sometimes the led turns off without any reason....

    Development

  • gateway serial and dimmer example
    M MCF

    this is the code i use :

    /**
    * The MySensors Arduino library handles the wireless radio link and protocol
    * between your home built sensors/actuators and HA controller of choice.
    * The sensors forms a self healing radio network with optional repeaters. Each
    * repeater and gateway builds a routing tables in EEPROM which keeps track of the
    * network topology allowing messages to be routed to nodes.
    *
    * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
    * Copyright (C) 2013-2015 Sensnology AB
    * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
    *
    * Documentation: http://www.mysensors.org
    * Support Forum: http://forum.mysensors.org
    *
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * version 2 as published by the Free Software Foundation.
    *
    *******************************
    *
    * DESCRIPTION
    * The ArduinoGateway prints data received from sensors on the serial link.
    * The gateway accepts input on seral which will be sent out on radio network.
    *
    * The GW code is designed for Arduino Nano 328p / 16MHz
    *
    * Wire connections (OPTIONAL):
    * - Inclusion button should be connected between digital pin 3 and GND
    * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
    *
    * LEDs (OPTIONAL):
    * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs
    * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
    * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
    * - ERR (red) - fast blink on error during transmission error or recieve crc error
    *
    */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    // Set LOW transmit power level as default, if you have an amplified NRF-module and
    // power your radio separately with a good regulator you can turn up PA level.
    #define MY_RF24_PA_LEVEL RF24_PA_LOW
    
    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    
    // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    #define MY_BAUD_RATE 38400
    #endif
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    
    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
    
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Inverses the behavior of leds
    //#define MY_WITH_LEDS_BLINKING_INVERSE
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
    
    #include <MySensors.h>
    
    #define LED_PIN 3      // Arduino pin attached to MOSFET Gate pin
    #define FADE_DELAY 10  // Delay in ms for each percentage fade up/down (10ms = 1s full-range dim)
    
    static int16_t currentLevel = 0;  // Current dim level...
    MyMessage dimmerMsg(1, V_DIMMER);
    MyMessage lightMsg(1, V_LIGHT);
    
    void setup()
    {
    	// Setup locally attached sensors
     request( 1, V_DIMMER );
    }
    
    void presentation()
    {
    	// Present locally attached sensors
     // Register the LED Dimmable Light with the gateway
     present( 1, S_DIMMER );
    }
    
    void loop()
    {
    	// Send locally attached sensor data here
    }
    void receive(const MyMessage &message)
    {
      if (message.type == V_LIGHT || message.type == V_DIMMER) {
    
        //  Retrieve the power or dim level from the incoming request message
        int requestedLevel = atoi( message.data );
    
        // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
        requestedLevel *= ( message.type == V_LIGHT ? 100 : 1 );
    
        // Clip incoming level to valid range of 0 to 100
        requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
        requestedLevel = requestedLevel < 0   ? 0   : requestedLevel;
    
        Serial.print( "Changing level to " );
        Serial.print( requestedLevel );
        Serial.print( ", from " );
        Serial.println( currentLevel );
    
        fadeToLevel( requestedLevel );
    
        // Inform the gateway of the current DimmableLED's SwitchPower1 and LoadLevelStatus value...
        send(lightMsg.set(currentLevel > 0));
    
        // hek comment: Is this really nessesary?
        send( dimmerMsg.set(currentLevel) );
    
    
      }
    }
    
    /***
     *  This method provides a graceful fade up/down effect
     */
    void fadeToLevel( int toLevel )
    {
    
      int delta = ( toLevel - currentLevel ) < 0 ? -1 : 1;
    
      while ( currentLevel != toLevel ) {
        currentLevel += delta;
        analogWrite( LED_PIN, (int)(currentLevel / 100. * 255) );
        delay( FADE_DELAY );
      }
    }
    
    Development
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular