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
RobbanR

Robban

@Robban
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ESP8266 WiFi gateway port for MySensors
    RobbanR Robban

    @rapzak said:

    Hi,

    I have added som support, where the gateway can upload data to emoncms, transparant to other functions (not fully testet):

    in gatewayutil add this in top of file, after the ARDUINO check:

    #define EMONCMS
    
    #ifdef EMONCMS
    static WiFiClient emon_client;
    const char* emon_host = "emoncms.org";  
    const int emon_httpPort = 80; 
    const int emon_addr_offset = 10;
    #endif
    

    Change this function to:

    void incomingMessage(const MyMessage &message) {
    //  if (mGetCommand(message) == C_PRESENTATION && inclusionMode) {
    //	gw.rxBlink(3);
    //   } else {
    //	gw.rxBlink(1);
    //   }
       // Pass along the message from sensors to serial line
       serial(PSTR("%d;%d;%d;%d;%d;%s\n"),message.sender, message.sensor, mGetCommand(message), mGetAck(message), message.type, message.getString(convBuf));
    #ifdef EMONCMS
         if (!emon_client.connect(emon_host, emon_httpPort)) {
          Serial.println("emoncms connection failed");
          }
    
          emon_client.print(String("GET /emoncms/input/post.json?&node="+ String(message.sender+emon_addr_offset)+"&json={"+String(message.sensor)+":"+message.getString(convBuf)+"}&apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n"));
          Serial.println(String("GET /emoncms/input/post.json?&node="+ String(message.sender+emon_addr_offset)+"&json={"+String(message.sensor)+":"+message.getString(convBuf)+"}&apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n"));
    #endif
    } 
    

    It will upload data with NODE ID and Sensor ID from the network, with an offset of emon_addr_offset...

    /Rapzak

    Are there any one that can help me implement this in the dev version? Have a nodemcu 1-0 and got errors uploading the 1.5 version so i cant use that. Tried to fix it but ended up with the dev version.

    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