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
G

gizi

@gizi
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Raw binary transmission
    G gizi

    Sorry for the confusion, this is using the SerialGateway - I have my own code server side parsing the serial responses. Everything after the 'mysensorsmqtt: serial recv -' is just dumps of the serial string received.

    Ill dig a little deeper into the code and look at the MyGateway side of the code, everything seemed in order but I will do some debugging.

    Development

  • Raw binary transmission
    G gizi

    Ok, so I am obviously missing something here, I saw you mention this solution in my searches, but I am unable to output a serialised hex string. My test code below appears to be setting the packetType correctly for the different types but for P_CUSTOM my results are an empty string...

    #include <MySensor.h>
    #include <SPI.h>
    
    #define CHILD_ID 3
    
    #define MS_CEPIN 8
    #define MS_CSPIN 7
    
    MySensor gw(MS_CEPIN, MS_CSPIN);
    
    unsigned int counter=0;
    unsigned int counter2=0;
    
    // Change to V_LIGHT if you use S_LIGHT in presentation below
    MyMessage msg(CHILD_ID,V_VAR1);
    
    void setup()
    {
    	gw.begin(NULL, 99);
    	gw.present(CHILD_ID, S_CUSTOM);
    }
    
    // some random buffer for testing
    char buffer[10] = {'H','e','l','l','o',' ','Y','o','u','\0'};
    
    void loop()
    {
    	//send something periodically
    	counter++;
    	if (counter == 0) {
    		counter2++;
    		gw.send(msg.set(buffer));	//pt=0 > P_STRING
    		gw.send(msg.set(counter2));	//pt=3 > P_UINT16
    		gw.send(msg.set(buffer,5)); //pt=6 > P_CUSTOM
    	}
    }
    
    

    My gateway returns the following when raw dumping the received serial data (this was the 61st send)...

    mysensorsmqtt: serial recv - 0;0;3;0;9;read: 99-99-0 s=3,c=1,t=24,pt=0,l=9:Hello You
    mysensorsmqtt: serial recv - 99;3;1;0;24;Hello You
    
    mysensorsmqtt: serial recv - 0;0;3;0;9;read: 99-99-0 s=3,c=1,t=24,pt=3,l=2:61
    mysensorsmqtt: serial recv - 99;3;1;0;24;61
    
    mysensorsmqtt: serial recv - 0;0;3;0;9;read: 99-99-0 s=3,c=1,t=24,pt=6,l=5:
    mysensorsmqtt: serial recv - 99;3;1;0;24;
    
    

    So the "pt=" seems to be set as expected, but no serialised hex. I must be missing something simple.

    Development

  • Raw binary transmission
    G gizi

    Hi All

    Just getting to grips with MySensors.

    Is there a means to transmit raw binary data. In particular the handling of the transmission from the gateway to the controller - maybe as a hexadecimal encoded string of characters?

    I wish to send some bytes of bit flags to my custom controller (which publishes onto MQTT), this controller parses the serial port looking for carriage return ('\n') characters to split the received packets. This obviously presents a problem if the payload data actually contains the '\n' carriage return as a valid bit flag value, splitting the packet incorrectly. (Not to mention all the other control characters that may be received).

    Is such a feature already possibly, or do I need to investigate the gateway code and implement this myself?

    Cheers
    Gizi

    Development

  • Gerber/Eagle files and then...?
    G gizi

    Try pcbshopper.com, to search multiple fab houses based on your board requirements.

    Hardware
  • Login

  • Don't have an account? Register

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