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
  1. Home
  2. Development
  3. Send data to internet (REST API, other?)

Send data to internet (REST API, other?)

Scheduled Pinned Locked Moved Development
7 Posts 3 Posters 2.1k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pelnarp
    wrote on last edited by
    #1

    Hi all,
    I was wondering if there is a way to send the values measured by wireless sensors to the internet service (ideally to RESTful API or another protocol, HTTP-based). The sensors are Arduino with NRF24L01. Could an Ethernet Gateway be used somehow to connect to the internet and send the data? Or is there any alternative solution?
    I basically want to be able to collect the data in the cloud and/or send command from the remote internet server over a secure channel. I do not want to use any third party controller (such as OpenHAB), but do the processing logic on my own in the cloud.
    Thank you for any thoughts!

    1 Reply Last reply
    0
    • sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #2

      Hi!

      I made a ethernet gateway send data to Nimbits (http://forum.mysensors.org/topic/363/datalogging-sensors-to-nimbits/3) a while ago.I changed the library to send the data with a json to nimbits. It wasnt stable thought and i gave it up and got myself a controller instead.

      I dont have any code left thought :(

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pelnarp
        wrote on last edited by
        #3

        Thanks for your swift advice! Does it mean you hacked the GatewayUtil.h of the EthernetGateway code from GitHub to send the data to REST API?

        1 Reply Last reply
        0
        • barduinoB Offline
          barduinoB Offline
          barduino
          wrote on last edited by
          #4

          I use something similar but it is on a serial gateway.

          I use a simple nodeJS program running where the serial gateway is connected.
          It reads from serial and sends to a REST api.
          If you're interested in this example I'll gladly share it.

          I've also seen folks using node-red to split the incoming messages and send it to more than one place, but i think it is serial gateway too.

          Cheers

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pelnarp
            wrote on last edited by
            #5

            Hi barduino,
            Thank you for your response! Yes, an example would be very much appreciated. Does it mean you have this simple serial gateway: http://www.mysensors.org/build/serial_gateway? and run the NodeJS program on the computer it is connected to? What do you use to read from serial gateway and send to REST API, RPi?

            barduinoB 1 Reply Last reply
            0
            • P pelnarp

              Hi barduino,
              Thank you for your response! Yes, an example would be very much appreciated. Does it mean you have this simple serial gateway: http://www.mysensors.org/build/serial_gateway? and run the NodeJS program on the computer it is connected to? What do you use to read from serial gateway and send to REST API, RPi?

              barduinoB Offline
              barduinoB Offline
              barduino
              wrote on last edited by
              #6

              Hi @pelnarp

              Yes i do have the vanila serial gateway.

              I run the nodeJS on a windows computer or on a raspberry pi depending on my setup, anyway nodeJS is available for may operating system flavors and the code run on all of them.

              You just need to adjust the com port on this line

              var serialPort = new com.SerialPort('COM3', {
                  baudrate: 115200,
              	parser: com.parsers.readline('\n')
                });
              

              Where it says COM3 (this is windows) in mac it will be similar to /dev/cu.usbmodem14141 and in raspberry pi or linux something like /dev/ttyACM0 representing the port where you have it connected.

              I use an authentication header to prevent tampering with the RESP API, I strongly reccomend you set up something similar if like me the REST API is on the cloud.

              And to receive the commands this nodeJS app also exposes a REST API which sends the commands back to serial gateway.

              Here are the files package.json gw.js, have fun!

              Anyway some food for though.

              I've seen folks here use a lot of MQTT, seems to be a very popular protocol for IOT and this type of stuff.

              The only reason I'm not using it is because I do not have a WL500 module for a ethernet gateway, I've tried with adafruit CC3000 with no success yet.

              Perhaps building a nodeJS app to translate the serial from MySensors to MQTT might be a good idea...

              Cheers

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pelnarp
                wrote on last edited by
                #7

                Many thanks for sharing, much appreciated!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                16

                Online

                11.7k

                Users

                11.2k

                Topics

                113.0k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

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