Pybytes not seeing my WiPy 2.0

Phil shared this problem 2 years ago
Known

I'm running linux Mint and I upgraded to the most recent firmware updater, flashed the new 1.17.5.b2 firmware onto my WiPy 2.0, removed the wire and reset it. It appeared to have connected to my home network, but I saw no connectin to pybytes. I then downloaded my custom firmware package from pybytes, unzipped it into a directory and synced that into my device using Atom/Pymakr. Doing that gives this dialog:

Syncing project (main folder)...

Reading file status

Failed to read project status, synchronizing all files

Creating dir lib

[1/10] Writing file boot.py

[2/10] Writing file config.py

[3/10] Writing file lib/mqtt_core.py

[4/10] Writing file lib/mqtt.py

[5/10] Writing file lib/OTA.py

[6/10] Writing file lib/pybytes_library.py

[7/10] Writing file lib/pybytes_protocol.py

[8/10] Writing file lib/pybytes.py

[9/10] Writing file lib/terminal.py

[10/10] Writing file main.py

Synchronizing done, resetting board...

ets Jun 8 2016 00:22:57


rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

configsip: 0, SPIWP:0xee

clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

mode:DIO, clock div:1

load:0x3fff8028,len:8

load:0x3fff8030,len:1728

load:0x4009fa00,len:0

load:0x4009fa00,len:14584

entry 0x400a059c

Using configuration config.py file from /flash folder

WMAC: 240ac4006d3c

Firmware: 1.17.5.b2

WiFi connection established

Using 8192 bytes as stack size

memory allocation failed, allocating 8192 bytes

main.py was executed properly (using a firmware that does not include frozen libraries)

Traceback (most recent call last):

File "_main.py", line 184, in <module>

File "/flash/lib/pybytes.py", line 60, in send_virtual_pin_value

File "/flash/lib/pybytes_protocol.py", line 526, in send_pybytes_custom_method_values

TypeError: unsupported types for : 'str', 'int'

MicroPython v1.8.6-849-b9d53b40 on 2018-05-03; WiPy with ESP32


Any ideas for getting this fixed would be appreciated!

-Phil

Comments (5)

photo
1

Hi Phil,


Can you send me the 3 files mentioned at the end of the logs (main.py, pybytes.py, pybytes_protocol.py) at alexis@pycom.io ?


When you added your device to pybytes, did you used the quick add device process or the former firmware updater tool?


Because the quick add device process flashes a firmware version that includes frozen code, which contains a default version of the files that you normally had to flash manually to the device, like pybytes_protocol.py.

So, in theory, using this firmware, you can simply transfer a project that contains only a main.py and your config.py.


Here I feel like that pybytes_protocole.py ran by your device is out dated or corrupted.


Thanks,


Alexis

photo
1

Thanks for the help, Alex:

Suspecting that the upgrade process could be an issue, I asked for help in https://pybytes.useresponse.com/topic/whats-happening-to-pybytes#comment-33. The response there seemed to suggest that I should just update my linux firmware updater, and then update my WiPy. Did I get that wrong? To answer your question, here's the process that I believe that I went through:

1) Download and apply the .deb package to my linux box

2) Created a pybytes account and added a new device (WiPy w/a WiFi shield (this seemed odd--WiFi isn't really a shield on a WiPy device). From this I got the pybytes identifier for my device.

3) connect the WiPy to my linux box and ran the updater (note: there were various error messages that popped up on the terminal screen, but the device did ultimately update). I was asked for and included the pybytes identifier

4) Rebooted the device

5) The device started, connected to my home network and then gave the error messages displayed.

I can't get to my files until later today, but I went to the line in question (File "/flash/lib/pybytes_protocol.py", line 526, in send_pybytes_custom_method_values) and it's a perfectly good looking python .append command.

-Phil

photo
1

Hello Phil,


I just went through the same steps as you and downloaded the pybytes libraries from here:

baadd98ae83af4876ac2b9678fc26d3b

(after adding a new device)


And the files from that download link are indeed outdated.


I'll let my colleagues know about that so you can download the proper libraries.


Btw, even if you used the quick add device (the recommended option because the device should be able to connect right away after the process) you would need at least the main.py from the libraries to be able to customize it and override the main.py included in the frozen code of the firmware, and actually be able to modify the behavior of your device.

I am just mentioning that here to let other people with the same issue know about it.


I will let you know here again when the download link will be ready.


Cheers,


Alexis

photo
1

Alexis:

Now that I see that link, it reminds me that I've only got WiPy 2.0 devices. Presumably they don't have enough memory. When I originally tried the quick add method, I never saw my device on the PyBytes console.

What's my path forward?

Also, specifically, which check boxes should I check when doing the firmware upgrade?

Thanks,

Phil

photo
1

From what I read in the logs you sent in the first place, the device started correctly and executed the code, otherwise it wouldn’t have been able to execute the main.py


With the libraries you have in your device right now, it’s perfectly logical that pybytes doesn’t show anything even if the device is connected to your wifi.


Let’s just see what happens with the updated libraries. :)

photo
1

Alexis writes:>I will let you know here again when the download link will be ready.

Any progress on this?

photo
1

Hello Phil, Sorry for the late reply!

Yes you can now download the latest libraries from the settings tab of your device, or by creating a new one.

From the downloaded files, you can simply flash the main.py and the config file to your device and it should work (using pymakr).

Beware that from now on the config.py is deprecated, the file pybytes_config.json will be used instead. The content of the two files is basically the same. The firmware is set up to create the .json file (if it doesn't exist) from the config.py file content (if it exists). If you have issues with this please let me know.

Otherwise, we have been encountering a strange issue when trying to login to pybytes lately: if you see the error message "Internal server error" when trying to sign in, please clear your browser's cache and try again, that should fix the problem.

Cheers, Alexis

photo
1

Indeed, when attempting to log into pybytes, (from chrome) I get

Internal errorUh Oh! Something wrong happened, please try again later, thanks.

Back to login page


So far, neither trying again later nor clearing the cache, etc., has not helped.

photo
1

Hello Phil,


Have you tried to refresh the page after clearing the cache?

photo
1

Seriously? Of course I tried refreshing the page. I also restarted the browser.

photo
1

Yeah, sorry... ^^

It appears to work for me, maybe the server (or some parts of it) was being updated at the time you tried. You can also try with another browser but if the cache isn't causing the issue it's unlikely that it can solve the problem.

If it still doesn't work, can you try to open the browser's console and send me what you have there after trying to login?


Thanks, Alex

photo