I tried to flash the unzipped pybytes.zip but...

duffo64 shared this problem 2 years ago
Known

Uploading project (flash)...

Not safe booting, disabled in settings

Reading file status

Failed to read project status, uploading all files

Creating dir lib

[1/10] Writing file boot.py

[2/10] Writing file config.py

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

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

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

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

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

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

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

[10/10] Writing file main.py

Upload 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:0x3fff9028,len:8

load:0x3fff9030,len:1060

load:0x4009fa00,len:0

ho 12 tail 0 room 4

load:0x4009fa00,len:14096

entry 0x400a05e0

Traceback (most recent call last):

File "boot.py", line 1

IndentationError: unexpected indent

Using default configuration from flash memory

Traceback (most recent call last):

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

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

File "/flash/lib/pybytes.py", line 1

SyntaxError: invalid syntax

Traceback (most recent call last):

File "main.py", line 1

IndentationError: unexpected indent


... Frustrated :(

Best Answer
photo

Ok, It works. My Atom/Pymakr combo was chewing all the files while uploading them to the board.

Comments (1)

photo
1

Hi Claudio,

what device are you using? what is the firmware in the device? was this device added previously by "quick add method" with firmware updater?

Can you describe your steps so we can try to replicate your problem here too?


Thank you

Jirka

photo
1

Here it is, thanks.

— factory reset
    import os
    os.mkfs(‘/flash’)

— add device in pybytes
— get unique id
— run the updater 1.12.0.b0 and paste the unique id
— wipy3 is online with firmware 1.17.0.b1
— download pybytes.zip
— extract it
— add folder into atom
— open pymakr.conf and paste the serial port device
— reboot into safe boot (G28 high at reset, jumper removed after a couple of orange blinks). Even a ctrl-f now should do the work.
-- connect pymakr
— upload
Uploading project (flash)...
Not safe booting, disabled in settings
Reading file status
Failed to read project status, uploading all files
Creating dir lib
[1/10] Writing file boot.py
[2/10] Writing file config.py
[3/10] Writing file lib/OTA.py
[4/10] Writing file lib/mqtt.py
[5/10] Writing file lib/mqtt_core.py
[6/10] Writing file lib/pybytes.py
[7/10] Writing file lib/pybytes_library.py
[8/10] Writing file lib/pybytes_protocol.py
[9/10] Writing file lib/terminal.py
[10/10] Writing file main.py

Upload 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:0x3fff9028,len:8
load:0x3fff9030,len:1060
load:0x4009fa00,len:0
ho 12 tail 0 room 4
load:0x4009fa00,len:14096
entry 0x400a05e0

Traceback (most recent call last):
File "boot.py", line 1
IndentationError: unexpected indent
Using default configuration from flash memory
Traceback (most recent call last):
File "_main.py", line 31, in <module>
File "_main.py", line 29, in <module>
File "/flash/lib/pybytes.py", line 1
SyntaxError: invalid syntax

MicroPython v1.8.6-849-8525e8d7 on 2018-02-27; WiPy with ESP32
Type "help()" for more information.
>>>

photo
1

Hi Claudio,

I just repeated your steps with Wipy3 and device boots successfully at the end.


But I may know where is your problem. We've made some changes to firmware which you can download form Pybytes.

Download reinstall it again. It will probably will show same version, which is misleading (we will fix that).

The fw updater from Pybytes will allow you to add device quickly - to have Pybytes library in /frozen folder. And also flash your extended Pybytes library in /flash folder.

Then library in /flash folder will have priority over /frozen folder.


Another way is just to download "stock" (no quick add feature) fw updater from https://pycom.io/downloads/

Then update firmware of your device. It will be updated with stock firmware (no Pybytes library in /frozen folder).

If you reboot your device, it just "sits" there doing nothing.

Then you can upload your pybytes library with Pymakr in Atom. Library will be written in /flash folder.

photo
1

No, wait, now it's online. Still, something is not clear to me.

Mumble...

photo
1

Hello again, Jirka.

Got the fast-track and now I have my wipy configured in pybytes, and pybytes library in /frozen (at least I think, since I don't see a /frozen folder via ftp). The main.py contained only a commented line # main.py -- put your code here!, so I overwrited it uploading a simple script:


import machine
import utime
import pycom
import sys

rtc = machine.RTC()
rtc.ntp_sync('10.168.193.34', 3600)
sec = 60
pycom.heartbeat(False)

while True:
    try:
        if sec >= 60:
            unxtime = utime.time()
            print(unxtime)
            pybytes.send_ping_message()
            sec = 0
        utime.sleep_ms(1000)
        sec = sec + 1
    except KeyboardInterrupt:
        pycom.heartbeat(True)
        sys.exit()

However, after upload, reset, and display of pybytes init stuff I got a SyntaxError: invalid syntax in main.py at line 1 (???)

Just to simplify I removed all the pycom related stuff (heartbeat), and after uploading it worked. Nice ! I have a script that does my things AND my wipy is live in pybytes pinging it every minute. I let it run for a bit, then I rebooted the board, and the same script started to give syntax error at line 1 again. Wait a couple of minutes, reboot, and it's working again without giving syntax error.

photo
1

Ok, I give up. Just don't understand.

photo
1

Ok, It works. My Atom/Pymakr combo was chewing all the files while uploading them to the board.

photo
1

nice;)

photo