Git Product home page Git Product logo

Comments (10)

bytespider avatar bytespider commented on May 23, 2024

from meross.

EddyBishop avatar EddyBishop commented on May 23, 2024

Hi Rob!
Thanks for your quick response!

My NodeJS vers is: v8.15.1

from meross.

bytespider avatar bytespider commented on May 23, 2024

from meross.

EddyBishop avatar EddyBishop commented on May 23, 2024

Oh thanks a lot!

With which version are you sure it works?

I can always downgrade NodeJS to a version compatible with your script

from meross.

bytespider avatar bytespider commented on May 23, 2024

I've updated the code to be used on Node 8.
I've also remove the interface in favour of --gateway

Let me know if it works for you.

from meross.

EddyBishop avatar EddyBishop commented on May 23, 2024

Hi Rob,
thank you very much for your interest!
I just tested the new script and...

sudo ./meross info --gateway 10.10.10.1

I receive the information of the object correctly

sudo ./meross setup --gateway 10.10.10.1 --wifi-ssid WIFISSID --wifi-pass WIFIPSW --mqtt 192.168.1.xx: 8883

The script works and the socket gets the new setup, then it restarts and tries to connect to the wifi, but unfortunately it can't connect correctly to my wifi and restarts after a few minutes :(

This is the code I receive after sending the "./meross setup":

Setting up device with IP 10.10.10.1
Setting MQTT servers [ { host: '192.168.1.15', port: '8883' } ]
sending payload { header:
{ method: 'SET',
namespace: 'Appliance.Config.Key',
messageId: '1' },
payload: { key: { gateway: [Object], key: '', userId: '' } } }
sending payload { header:
{ method: 'SET',
namespace: 'Appliance.Config.Wifi',
messageId: '1' },
payload:
{ wifi:
{ ssid: 'VEFSRElTX0VYVA==',
password: 'RGVjaW1vRG90dG9yZTEwIQ==' } } }
{ header:
{ messageId: '1',
namespace: 'Appliance.Config.Wifi',
method: 'SETACK',
payloadVersion: 1,
from: '/appliance/1805034347250425180134298f116cf7/publish',
timestamp: 454,
timestampMs: 670,
sign: '3bbfdde8842a5c44a0323518eec97cbe' },
payload: {} }

Is it possible that the problem is in this part of the code?

sending payload { header:
{ method: 'SET',
namespace: 'Appliance.Config.Wifi',
messageId: '1' },
payload:
{ wifi:
{ ssid: 'VEFSRElTX0VYVA==',
password: 'RGVjaW1vRG90dG9yZTEwIQ==' } } }

I noticed that it shows an ssid ('VEFSRElTX0VYVA==') and a password ('RGVjaW1vRG90dG9yZTEwIQ==') different from the ones I enter on the command string.

Sorry again for my horrible English!

from meross.

bytespider avatar bytespider commented on May 23, 2024

No the values are base64 encoded and sent to the device as thats what the devices expect.

If the device light flashes green then resets I expect either your WIFI credentials are incorrect (or you’re using 5Ghz? I think these only support 2.4Ghz) or it cannot connect to your mqtt server.

Test if you can connect to the MQTT server via mosquito, you have to pass it the certificate using the —cafile option something along the lines of mosquitto_sub -h 192.168.1.15 -p 8883 -t topic --cafile /path/tp/cafile.pem

from meross.

EddyBishop avatar EddyBishop commented on May 23, 2024

Hi rob,
the script works great, I think the problem is my Mosquitto configuration.

Does Mosquitto need to be installed on the same system that I use to configure the MSS310 with your setup script?

I have to connect the MSS310 to the mosquitto broker installed on my Raspberry (on which Home Assistant runs), is it possible that the right certs for connection to the MQTT broker are missing on my Raspberry?

Can you recommend a good guide to configure Mosquitto with certs?

Thanks!

from meross.

bytespider avatar bytespider commented on May 23, 2024

You'll need Mosquitto client applications order to test the broker on you RasPi.

I followed this tutorial to get mine set up https://mcuoneclipse.com/2017/04/14/enable-secure-communication-with-tls-and-the-mosquitto-broker/

My resulting minimal config is detailed here: https://github.com/bytespider/Meross/wiki/MQTT

from meross.

bytespider avatar bytespider commented on May 23, 2024

Closing due to inactivity

from meross.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.