Fabi019 / MerossBLE

Android app to setup supported Meross devices (including MSS110 MSS305 MSS210 MSS310 MSS425FC MSS510X MSS620 MSS630 MSS710 MSL120DA MSL210 MRS100 EM06) using bluetooth LE
GNU General Public License v3.0
2 stars 0 forks source link

will we have an apk? #1

Open carborundum7 opened 6 months ago

carborundum7 commented 6 months ago

Tried to buid from source with my limited skills with no luck. can we have an apk for old android devices? like android 8?

Fabi019 commented 6 months ago

Hi, thanks for your interest. I will create a release which will contain an signed apk to download. In theory the app should be compatible and installable on devices as low as android 7.0 (maybe even lower). However since I don't have such a device I haven't tested it out.

carborundum7 commented 6 months ago

that would be very nice! I appreciate so much your work, it will help me and other in the future to self host data from meross devices

Fabi019 commented 6 months ago

I just published the release. If you want to try it out, let me know if everything works or if there are any problems

carborundum7 commented 6 months ago

you're a boss!! thanks! so downloaded, installed. i have the mss305zt smart plug and i can see it with the app via bluetooth, without device info. for some reason i cant load wifi ssid list. it seems that the device does not answer back i was wondering, do i need to pass trough home assistant or connect directly to an mqtt broker? again, thank you very much

Fabi019 commented 6 months ago

Does the device answer if you press the read button for the device info or only for the wifi list not? To better look into this, it would be help me if you could tell me what android version your device runs. Also if possible, a (partial) screenshot of the log window inside the app.

Fabi019 commented 6 months ago

I was able to fix a bug that affected devices with android version lower than 12 and caused them to not receive any data. You can try out the latest release to see if that fixed the problem.

carborundum7 commented 6 months ago

Hi! Thank you for updates, very appreciated. Right now, with the updated app I can connect to the device and read its info, set up Matt server and port and the userID stuff (that I'm still figuring out). When I try to set the wifi configuration, i can read all wifi connections but somehow it wont accept them. Tried with 2 2.4ghz connections but nothing. From logs the only things that I can see is a crc error. Everything is shown in screenshots. My system is an android 9 A question: is there any way to just set the mqtt broker, login and password for the mqtt, connecting straight to the broker? Again, thank you very much

Screenshot_20240223-092914_MerossBLE Screenshot_20240223-092832_MerossBLE

Fabi019 commented 6 months ago

From the logs I can see, that the switch responded with a SETACK. This would mean that it sucessfully received the wifi configuration.

What is the behaviour of the led on the switch? Normally after writing the wifi it should start blinking only green while trying to connect to the wifi.

When this was successful, the light should stay on.

If the connection to the wifi was not possible, it should go back to the alternating color blink mode. That would mean it couldn't connect to the wifi. As a first attempt, I would recomment double checking the password and also if your wifi maybe has some sort of mac filter that blocks unknown devices.

carborundum7 commented 6 months ago

I have alternating blinking color. Will double check and update you Thank you🤙

carborundum7 commented 6 months ago

i'm back! so i found 2 issues: -my wifi password is like 70 caracters long, for some reason is not working. changing it to something like 11111111 works but i'm not comfortable reducing wifi security -when connected, i have solid red light. i have tried several combination of ip adresses and hostnames to point to my mqtt server but no luck. maybe you can tell me more about the structure of the input data, please

Fabi019 commented 6 months ago

Thanks for reporting back. Good to hear that it worked at least with shorter passwords. I will try to find the reason why it doesn't works with longer ones.

Regarding the mqtt server. It is important, that it is a encrypted mqtt server. The normal one over port 1883 won't work as the device will not connect with it. You will need a seperate server listener eg. on port 8883. When using mosquitto as the broker you can define multiple interfaces (port 1883 and 8883). A good guide on how to setup the server/certificates can be found here https://github.com/bytespider/Meross/wiki/MQTT. In the end you mosquitto.conf could look like this:

allow_anonymous true

listener 8883
require_certificate false

cafile   ../certs/ca.crt
certfile ../certs/server.crt
keyfile  ../certs/server.key

listener 1883
carborundum7 commented 6 months ago

hi, thanks for the update. i have kinda implemented all the certificate stuff but still the main issue is the password lenght with special caracters. same password works well with the meross official app anyway, have a nice day :)

Fabi019 commented 6 months ago

I was able to fix a bug in the password encryption calculation that affected passwords longer that 16 characters in the latest version. This might solve your password issue.

carborundum7 commented 6 months ago

woohoo!!! works! now i has connected to my router without issues. you're the best! :D now i have the red static light and i can see the meross device from the router list of devices. so now i will try to configure mqtt with port 8883 and report my progress here, for people that would want to do the same thank you, your're the BOSS!!

carborundum7 commented 6 months ago

hi, i'm giving up. your app is perfect but i can't make the device connect to my mqtt server. i have tried everything: using different computers, generating certificates with different common names, reading left and right for every solution, changing permissions but the device just refuses to turn green. it happened once yesterday but i have no idea on how to replicate that behaviour.. i will open the device, remove the microcontroller, connect an esp8266 directly to the power sensor and read all the data that way i'm really grateful for your work, thank you a lot!!!

Fabi019 commented 6 months ago

Did you also look into the logs of the mqtt server to comfirm that it doesn't connect? For me it also was the case for one switch that was on red but actually connected sucessfully and I was able to control the device in home assistant. After some time then it turned itself green.

carborundum7 commented 6 months ago

now i have discovered that it does connect and puplishes a strange json. what i'm looking for is the power value but from mqtt explorer, i just get the bind info... i'm searching on how to send commands to the device but for now no luck. will update on progress