Open VladoPortos opened 4 years ago
Wow, lot's to address. As you found, I used the specific version of MP for the bluetooth support. I also get the SPI error. No clue about the ampy issue. I don't have a problem. Saving devices to a file is obviously possible. Had you thought of trying it yourself? I also get loads of connection error. The biggest effort in the code was dealing with all the errors. It doesn't matter that it finds other devices. It will only use those called LYWSD03MMC. The missing leading zero in the MAC address is a bug and I will address that.
Can you let me know if the new version of ble.py fixes the spaces in the mac address?
Hi @AnthonyKNorman I'm going at it whole morning ( also created merge request for the fix of prettify function, you have implemented the same fix I have proposed :) ) however as you say there is lots of connection errors.
Some of them I can't really explain... from the output it never connect to the device at first try, it have to do it 3+ time to get connection and reply... same goes for getting names of the device during the initial scan, and this is bigger issue for me as it tends to miss one device ( in my case it will detect all 5 devices, but tend to miss one at random because it could not get it name back, And sometimes it will find all 5 ok ) I have tried to extend the scanning time and also connection scanning time, nothing seems to help.
I don't know what to suggest. I think the bluetooth connection to these things is pretty flaky. It took much longer to build in all the error handling than it did to get it to initially connect.
Hi,
Just got mine to work and noticed that there is lots of connection issues in the log:
2020-08-18 06:32:57 Error: Connect [Errno 114] EALREADY
2020-08-18 06:33:01 Error: Connect [Errno 114] EALREADY
2020-08-18 06:33:03 Error: Connect [Errno 114] EALREADY
2020-08-18 06:33:05 Error: Connect [Errno 114] EALREADY
2020-08-18 06:33:12 Error: Connect [Errno 114] EALREADY
2020-08-18 06:33:17 Found Address: a4:c1:38:0f:39:c8 Name: LYWSD03MMC
2020-08-18 06:33:17 Found Address: a4:c1:38:1b:74:08 Name: LYWSD03MMC
2020-08-18 06:33:18 Time set from server
2020-08-18 06:33:19 Error: Connect [Errno 114] EALREADY
2020-08-18 06:33:33 Error: Connect [Errno 114] EALREADY
2020-08-18 06:34:40 Error: Connect [Errno 114] EALREADY
2020-08-18 06:34:43 Error: Connect [Errno 114] EALREADY
2020-08-18 06:34:54 Error: Connect [Errno 114] EALREADY
2020-08-18 06:34:56 Error: Connect [Errno 114] EALREADY
As you can see these errors came just within few minutes. It seems that everything is working as it should despite those connection errors but I'm a bit worried that there would be a lot of junk after a while. Is the log file rotated or how could I disable logging?
Hello, Thanks so much for this, it works ok ( although I'm coding in python a lot, this was first time micropython ) Issues I had:
not sure what module you used, I have Wemos ESP32 - ESP Wroom 32 uploading the micropython from setup guide (with spiram) will work, just produce error lines at start saying that it could not enable ram or something like that, which makes sense as this module does not have external ram. So i tried to install the no-spiram version, and that one does not have ubloototh module :D...
I could not upload anything to ESP32 it gave me error:
ampy.pyboard.PyboardError: could not enter raw repl
To solve that I had to edit file: pyboard.py to add one line:After that it uploaded fine.
Feature: it is running now, and sending messages to MQTT server, I have 5 sensors and would be cool to identify them somehow ( maybe utilize the BLE icon the show when connected )
Strange looking errors ( not sure if to worry about that ) this one: Error: Connect [Errno 114] EALREADY
Feature request ? have one script to scan for the devices print the output and safe to file... ( maybe let us edit it ) and not have it scan every time it restarts, it takes 5 min to finish :-/
Issue: wrong device detected ?
Thats about it what I had from today :D