Send fake data to FHEM without transmitter



  • Hello.
    I want to use the mysensors way to connect my selfmade sensors to FHEM.
    I don´t have aNRF24 or RFM69. I use cheep 433 RX / TX modules and this will work with my arduino sketch.
    The trabsmitter is an Attiny85 with DHT11 and 433 and the reciver is an Arduino Uno with display.
    This will work, but i want to use a system like FHEM (or if i can not use this because im to stupid so i search another system)

    My transmitter only will send a 5 digit number, SenderID, Temp, Hum...
    Now i want to convert my data to mysensors protokoll for use with FHEM.
    Im new on FHEM so i must have any input device for testing.

    So i use a sketch for my Arduino Nano and try it...but for any sketch i need a Transmitter like NRF24.
    The sketch will oct work without...so i can not send anything 😞

    I read this
    https://www.mysensors.org/download/serial_api_20

    So i was testing with my Arduino Nano and serialprint, and serialprintln.
    I try
    Serial.println("12:1:1:0:0:36.5");
    Serial.println("12;1;1;0;0;36.5");
    .... and other to simulate a temp sensor .
    But it will not work.

    Can anyone help me ?
    Other problem is FHEM. I define a sensor

    define Sensor MYSENSORS /dev/ttyUSB0@115200

    This will show me connected if i put my Arduino into my Pi3.
    But i dont know what is to do then...
    What must i do fist, define MYSENSORS or define MYSENSORS_DEVICE ?.😭

    Many thanks for any help


  • Admin

    Probably easier to use the serial gateway as a starting point.

    Present your sensors (in the presentation()-function).. and then just use the send-function. It translates your commands into the serial MySensors protocol.

    Note, you have to download the current development-branch.



  • Hello.
    I want use the serial gateway...but i don´t want to use the NRF24 at this moment.
    I only want to know the data format send via USB.
    So the data format is:

    node-id;child-sensor-id;message-type;ack;sub-type;payload\n

    but i want send this by myself with an arduino sketch.
    I think i can send this data via serialprint ?


  • Admin

    You don't need to activate any radio for the gateway.



  • Ok, thanks.
    In the gateway i can disable radio.
    But i get an error in the log of FHEM

    MYSENSORS: ignoring set-msg from unknown radioId 0, childId 0 for V_LEVEL

    Can i set the radio ID by myself ?


  • Admin

    Like I said earlier, do you have the latest MySensors version from the development branch installed?



  • I delete the library and copy the developer library to the the arduino folder.
    In serial monitor see this

    0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.0.1-beta
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;17;2.0.1-beta
    0;255;3;0;11;Dust Sensor
    0;255;3;0;12;1.1
    0;1;0;0;24;
    0;255;3;0;9;MCO:REG:NOT NEEDED
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
    Raw Signal Value (0-1023): 388 - Voltage: 1.89 - Dust Density: 222.07
    0;1;1;0;37;223
    Raw Signal Value (0-1023): 241 - Voltage: 1.18 - Dust Density: 100.05
    0;1;1;0;37;101
    

    FHEM show me

    2016.09.14 19:14:06 3: Setting MYS_GW serial parameters to 115200,8,N,1
    2016.09.14 19:14:06 5: MYSENSORS send: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=002(I_VERSION       ) ack=0 ''
    
    2016.09.14 19:14:06 5: SW: 303b303b333b303b323b0a
    2016.09.14 19:14:06 1: /dev/ttyUSB0 reappeared (MYS_GW)
    2016.09.14 19:14:07 5: MYSENSORS/RAW: /0;255;3;0;9;MCO:BGN:INIT GW,CP=R
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;255;3;0;9;MCO:BGN:INIT GW,CP=R/-NGA--,VER=2.0.1-beta
    0;255;3;0;
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'MCO:BGN:INIT GW,CP=R-NGA--,VER=2.0.1-beta'
    
    2016.09.14 19:14:07 5: MYSENSORS gateway MYS_GW: MCO:BGN:INIT GW,CP=R-NGA--,VER=2.0.1-beta
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;255;3;0;/14;Gateway startup complete.
    0;2
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=014(I_GATEWAY_READY ) ack=0 'Gateway startup complete.'
    
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;2/55;0;0;17;2.0.1-beta
    0;255;3;0;1
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=000(C_PRESENTATION) st=017(S_ARDUINO_NODE  ) ack=0 '2.0.1-beta'
    
    2016.09.14 19:14:07 3: MYSENSORS: ignoring presentation-msg from unknown radioId 0, childId 255, sensorType 17
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;255;3;0;1/1;Dust Sensor
    0;255;3;0;12;1.1
    0
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=011(I_SKETCH_NAME   ) ack=0 'Dust Sensor'
    
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=012(I_SKETCH_VERSION) ack=0 '1.1'
    
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0/;0;0;0;24;
    0;255;3;0;9;MCO:REG:N
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=000 c=000(C_PRESENTATION) st=024(S_DUST          ) ack=0 ''
    
    2016.09.14 19:14:07 3: MYSENSORS: ignoring presentation-msg from unknown radioId 0, childId 0, sensorType 24
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;255;3;0;9;MCO:REG:N/OT NEEDED
    0;255;3;0;9;MCO:BGN:ST
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'MCO:REG:NOT NEEDED'
    
    2016.09.14 19:14:07 5: MYSENSORS gateway MYS_GW: MCO:REG:NOT NEEDED
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;255;3;0;9;MCO:BGN:ST/P
    0;255;3;0;9;MCO:BGN:INIT OK,ID
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'MCO:BGN:STP'
    
    2016.09.14 19:14:07 5: MYSENSORS gateway MYS_GW: MCO:BGN:STP
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;255;3;0;9;MCO:BGN:INIT OK,ID/=0,PAR=0,DIS=0,REG=1
    Raw Signal 
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1'
    
    2016.09.14 19:14:07 5: MYSENSORS gateway MYS_GW: MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
    2016.09.14 19:14:07 5: MYSENSORS/RAW: Raw Signal /Value (0-1023): 1023 - Voltage: 
    2016.09.14 19:14:07 5: MYSENSORS/RAW: Raw Signal Value (0-1023): 1023 - Voltage: /5.00 - Dust Density: 749.17
    0;0
    2016.09.14 19:14:07 5: MYSENSORS Read: Raw Signal Value (0-1023): 1023 - Voltage: 5.00 - Dust Density: 749.17is no parsable mysensors message
    2016.09.14 19:14:07 5: MYSENSORS/RAW: 0;0/;1;0;37;750
    
    2016.09.14 19:14:07 5: MYSENSORS Read: Rx: fr=000 ci=000 c=001(C_SET         ) st=037(V_LEVEL         ) ack=0 '750'
    
    2016.09.14 19:14:07 3: MYSENSORS: ignoring set-msg from unknown radioId 0, childId 0 for V_LEVEL
    

    😞

    EDIT: I only put something in the code to let write some data.
    There was no example with temperature or somthing simple, so i use the dust example.


  • Admin

    Hmm. Wonder why about this message "ignoring presentation-msg from unknown radioId".

    I know too little about FHEM to answer you unfortunately.



  • The serial output is ok ?

    0;255;3;0;9;MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1

    Can i define a ID by myself ?


  • Admin

    No, a gateway always get id=0



  • Ok, the gateway, but i want to simulate an sensor...or is there no way to do this ?


  • Admin



  • Ok, thanks for your help.
    I will stop here now.


Log in to reply
 

Suggested Topics

  • 3
  • 1
  • 1
  • 6
  • 5
  • 2

45
Online

11.4k
Users

11.1k
Topics

112.6k
Posts