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. My Project
  3. MySensors Php API class + command line script + Form

MySensors Php API class + command line script + Form

Scheduled Pinned Locked Moved My Project
9 Posts 3 Posters 3.7k 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.
  • soifS Offline
    soifS Offline
    soif
    Plugin Developer
    wrote on last edited by soif
    #1

    As I needed a simple tool to test MySensors send/receive messages, I've created a basic php class, including a command line script , that can be used to send/receive mysensors messages directly to the Ethernet Gateway.

    You can use it in your php controllers, or directly on the command line by tapping commands like:

    ./mysensors_bin.php 192.168.0.240 set 12 0 V_STATUS 1
    

    This example send a command to the gateway at IP 192.168.0.240, to set the V_STATUS to 1, for Node 12, child 0...

    The project is at GitHub, and your contributions are most welcome !
    https://github.com/soif/MySensors_Php_API

    BTW I did my best to understand how MySensors messages worked, but without more documentation, I may have missed some things. So test it, and feel free to commit PR to the develop branch !

    HTH :-p

    1 Reply Last reply
    4
    • soifS Offline
      soifS Offline
      soif
      Plugin Developer
      wrote on last edited by
      #2

      Currently Working (develop branch) on a convenient form to convert/send messages .

      Form

      It should certainly help developers to test their sensors/gateway ;-)

      1 Reply Last reply
      3
      • soifS Offline
        soifS Offline
        soif
        Plugin Developer
        wrote on last edited by
        #3

        I've just posted version 1.1, including the form showed above. ;-)

        Any current users ?
        Comments?

        soifS 1 Reply Last reply
        0
        • soifS soif

          I've just posted version 1.1, including the form showed above. ;-)

          Any current users ?
          Comments?

          soifS Offline
          soifS Offline
          soif
          Plugin Developer
          wrote on last edited by
          #4

          Updated to v1.2 adding Serial gateway experimental support!

          As I don't have any serial gateway to test, I can't figure if it work or not, but I've implemented all the needed components to make it work.

          Would you please test if it work fine for you, and push some PR if some things need to be fixed for the serial connection.
          If you had to modify the "PhpSerial" class, would you please also push it back to the original developer repo

          HTH

          1 Reply Last reply
          0
          • ahmedadelhosniA Offline
            ahmedadelhosniA Offline
            ahmedadelhosni
            wrote on last edited by
            #5

            Great idea.

            I am trying to run the form.php but "select type first" doesn't change. tested on chrome and IE

            1 Reply Last reply
            0
            • soifS Offline
              soifS Offline
              soif
              Plugin Developer
              wrote on last edited by soif
              #6

              Seems like Chrome + IE does not like function argument default values in JS, while mozilla does.

              I've just pushed v1.21 which fixes this bug.

              git pull ;-)

              ahmedadelhosniA 1 Reply Last reply
              0
              • soifS soif

                Seems like Chrome + IE does not like function argument default values in JS, while mozilla does.

                I've just pushed v1.21 which fixes this bug.

                git pull ;-)

                ahmedadelhosniA Offline
                ahmedadelhosniA Offline
                ahmedadelhosni
                wrote on last edited by
                #7

                @soif Great. I will test it tomorrow.
                Thanks

                1 Reply Last reply
                0
                • soifS Offline
                  soifS Offline
                  soif
                  Plugin Developer
                  wrote on last edited by
                  #8

                  If you dont use git just replace the form.php with the one at GitHub

                  Let me know if it works flawlessly (eth or serial?).

                  cheers

                  1 Reply Last reply
                  0
                  • Ivan ZI Offline
                    Ivan ZI Offline
                    Ivan Z
                    Hardware Contributor
                    wrote on last edited by
                    #9

                    There is my php module for MajorDomo https://github.com/Shagrat2/majordomo-mysensor
                    His contain library for MYSensor phpMS.php, and to extend classes for Serrial & TCP (phpMSCom.php, phpMSTcp.php)

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


                    22

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    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