MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-SensorGateway

    Scheduled Pinned Locked Moved Utilities
    15 Posts 6 Posters 4.5k Views 6 Watching
    Loading More Posts
    • 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.
    • D Offline
      dmd
      last edited by dmd

      Tried this with 3b/3b+ (python 2.7/3.6), when installing module I get the following error:

      pi@raspberrypi:~/MagicMirror/modules/MMM-SensorGateway $ npm install
      npm WARN deprecated exec@0.2.1: deprecated in favor of builtin child_process.exe                                                                             cFile
      
      > websocket@1.0.31 install /home/pi/MagicMirror/modules/MMM-SensorGateway/node_m                                                                             odules/websocket
      > (node-gyp rebuild 2> builderror.log) || (exit 0)
      
      make: Entering directory '/home/pi/MagicMirror/modules/MMM-SensorGateway/node_mo                                                                             dules/websocket/build'
        CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
        SOLINK_MODULE(target) Release/obj.target/bufferutil.node
        COPY Release/bufferutil.node
        CXX(target) Release/obj.target/validation/src/validation.o
        SOLINK_MODULE(target) Release/obj.target/validation.node
        COPY Release/validation.node
      make: Leaving directory '/home/pi/MagicMirror/modules/MMM-SensorGateway/node_mod                                                                             ules/websocket/build'
      MMM-SensorGateway@1.0.0 /home/pi/MagicMirror/modules/MMM-SensorGateway
      ├── exec@0.2.1
      └─┬ websocket@1.0.31
        ├─┬ debug@2.6.9
        │ └── ms@2.0.0
        ├─┬ es5-ext@0.10.53
        │ ├─┬ es6-iterator@2.0.3
        │ │ └─┬ d@1.0.1
        │ │   └── type@1.2.0
        │ ├─┬ es6-symbol@3.1.3
        │ │ └─┬ ext@1.4.0
        │ │   └── type@2.0.0
        │ └── next-tick@1.0.0
        ├── nan@2.14.0
        ├─┬ typedarray-to-buffer@3.1.5
        │ └── is-typedarray@1.0.0
        └── yaeti@0.0.6
      
      npm WARN MMM-SensorGateway@1.0.0 No repository field.
      
      
      

      I can see the temperature with “ruuvitag -f” in console. If I try to see the status with “sudo service local_blegateway status” I get:

      pi@raspberrypi:~ $ sudo service local_blegateway status
      ● local_blegateway.service - local_blegateway, Movesense and RuuviTag BLE advertisement message gateway to websocket interface
         Loaded: loaded (/lib/systemd/system/local_blegateway.service; enabled; vendor preset: enabled)
         Active: activating (auto-restart) (Result: exit-code) since Fri 2019-12-20 17:04:04 EET; 1s ago
        Process: 1972 ExecStart=/usr/share/local_blegateway/local_blegatewaykickstart.sh (code=exited, status=1/FAILURE)
       Main PID: 1972 (code=exited, status=1/FAILURE)
      
      joulu 20 17:04:04 raspberrypi systemd[1]: local_blegateway.service: Unit entered failed state.
      joulu 20 17:04:04 raspberrypi systemd[1]: local_blegateway.service: Failed with result 'exit-code'.
      
      

      Any hints?

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        mattileh @dmd
        last edited by

        @dmd Hi!, Python 2.7.16 is the exact python version I’ve used.

        the exec module warning is expected, is there something in the snippet you sent that indicates that something went wrong in the module installation?

        btw, how did the service installation itself go? (there is an expected output in the instructions) and can you try running the gateway python script directly? e.g. :

        sudo python bleAdvWebSocket.py
        

        and post the results here.

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          stickymongoose @mattileh
          last edited by

          @mattileh I gt exactly the same error as @dmd. When I run bleAdvWebSocket.py manually I get the following:

          pi@mirror-pi:~/MagicMirror/modules/MMM-SensorGateway/gateway $ python bleAdvWebSocket.py 
          Traceback (most recent call last):
            File "bleAdvWebSocket.py", line 13, in module
              import websocket
          ImportError: No module named websocket
          
          M 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil
            last edited by

            There is a lot of install work for this module. Did u guys run the install script per the readme?

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • M Offline
              mattileh @stickymongoose
              last edited by

              @stickymongoose Hi! the websocket module is installed in the gateway module installation - can you double check you’ve ran README.md:41

              * run `npm install` in module's directory to install websocket and exec modules.
              

              also the local run of advSocket needs root access so please run it with the snippet above (e.g. with sudo in front, or from root user)

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jo-Rien
                last edited by

                Is there a fix to the before mentioned errors?

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  mattileh @Jo-Rien
                  last edited by

                  @Jo-Rien I’m not quite sure yet what are the problems, as sdetweil mentioned the module has quite extensive setup part elaborated in the readme.md. and also that one issue I’d like to see answered if the sudo fixed it.

                  I could probably try to do a “clean install” during July’s time and update the instructions if found something.

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    Jo-Rien
                    last edited by

                    @mattileh
                    I followed your reame.md and everything is going according the readme until i start up the ble service and check the status. It is giving me a error on the local_blegatewaykickstart.sh status is 1/Failure.
                    When running ruuvitag -f it will show all ruuvitags just fine, digging in the code a little and the error it seems there is a problem with websocket and codeparser i get this as missing modules, maybe this helps to solve the problem?

                    M 1 Reply Last reply Reply Quote 0
                    • M Offline
                      mattileh @Jo-Rien
                      last edited by

                      @Jo-Rien thanks!, yep its most likely about the missing modules - I did a “clean install” with the latest master (see merged PR#1 for details) and it seemed to install all related dependencies now with the install - script, could you try again now?

                      In case its still not working, would you like to debug this together for example in Discord?

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jo-Rien
                        last edited by

                        I’m going to try if it works now, will let you know.

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy