danicampora / pymakr-setup-kitchen

Other
0 stars 0 forks source link

pyboard.py websockets support #1

Open iSevenDays opened 7 years ago

iSevenDays commented 7 years ago

Hello

As I understand you are responsible for the MicroPython development and also you introduced PyMakr.

I wanted to use PyMakr with ESP8266, but I found that PyMakr has only Telnet and Serial connections support.

I was able to add the websockets feature to the PyMakr, but there is one problem. ESP8266 seems doesn't have enough RAM to support it, but anyway I hope my code would be useful.

I think that PyMakr and especially MicroPython would me much more useful with good IDE.

Source code: https://gist.github.com/iSevenDays/5440c1f0b7a7dbbe380f5db0fbe56dd9

Log from PyMakr IDE:

Remember, you can always click on this window to connect to a MicroPython device!
Connecting...
Connected!
Connection closed
Reattempting in 15 seconds...
Connecting...
Connected!
Connection closed

Log from ESP8266:

YB: soft reboot
#5 ets_task(40100390, 3, 3fff6300, 4)
Traceback (most recent call last):
  File "boot.py", line 1, in <module>
  File "webrepl.py", line 64, in start
  File "webrepl.py", line 21, in setup_conn
OSError: [Errno 12] ENOMEM
could not open file 'main.py' for reading
MicroPython v1.8.2-88-g4a27ad0-dirty on 2016-08-05; ESP module with ESP8266
Type "help()" for more information.
>>> Fatal exception 3(LoadStoreErrorCause):
epc1=0x40211215, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40280160, depc=0x00000000

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 30832, room 16 
tail 0
chksum 0x5e
load 0x3ffe8000, len 1060, room 8 
tail 12
chksum 0x25
ho 0 tail 12 room 4
load 0x3ffe8430, len 3000, room 12 
tail 12
chksum 0x3b
csum 0x3b
��lܞ|����rob���l�b�$b서���#�#l`ldܟ|����rnB��l����b��b�����b��#l �dܟ|����{n#���$����b�"�ܜ����"�lbl��r�l�$��$`��r�$�l�$`��r�$���$l`{l���o���bl�c{|�bp��Bc#��o�on�$d��d쏄l��l$���l��$`��#4 ets_task(40100390, 3, 3fff6300, 4)
WebREPL daemon started on ws://0.0.0.0:8266
Started webrepl in normal mode
scandone
state: 0 -> 2 (b0)
could not open file 'main.py' for reading

MicroPython v1.8.2-88-g4a27ad0-dirty on 2016-08-05; ESP module with ESP8266
Type "help()" for more information.
>>> state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt 

connected with Apple, channel 7
dhcp client start...
ip:192.168.76.9,mask:255.255.255.0,gw:192.168.76.1
pm open,type:2 0

WebREPL connection from: ('192.168.76.4', 49835)

>>> 
MicroPython v1.8.2-88-g4a27ad0-dirty on 2016-08-05; ESP module with ESP8266
Type "help()" for more information.
>>> 
PYB: soft reboot
#5 ets_task(40100390, 3, 3fff6300, 4)
Traceback (most recent call last):
  File "boot.py", line 1, in <module>
  File "webrepl.py", line 64, in start
  File "webrepl.py", line 21, in setup_conn
OSError: [Errno 12] ENOMEM
could not open file 'main.py' for reading
MicroPython v1.8.2-88-g4a27ad0-dirty on 2016-08-05; ESP module with ESP8266
Type "help()" for more information.
>>> Fatal exception 3(LoadStoreErrorCause):
epc1=0x40211215, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40280160, depc=0x00000000

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 30832, room 16 
tail 0
chksum 0x5e
load 0x3ffe8000, len 1060, room 8 
tail 12
chksum 0x25
ho 0 tail 12 room 4
load 0x3ffe8430, len 3000, room 12 
tail 12
chksum 0x3b
csum 0x3b
��$��|��rrnb��l�#�lB�����b�lrll$��|����rob��l����#�#쌜���b��#l �$��|��{rob���d����B�B�ܜ����b�bl`��r�l�d��l ��r�l�$�l ��{�d���$l`{$��{l���#$�bs|� ���b##��N�nN�$l��$��l��$l���l��$��#4 ets_task(40100390, 3, 3fff6300, 4)
WebREPL daemon started on ws://0.0.0.0:8266
Started webrepl in normal mode
scandone
state: 0 -> 2 (b0)
could not open file 'main.py' for reading

MicroPython v1.8.2-88-g4a27ad0-dirty on 2016-08-05; ESP module with ESP8266
Type "help()" for more information.
>>> state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt 

connected with Apple, channel 7
dhcp client start...
ip:192.168.76.9,mask:255.255.255.0,gw:192.168.76.1
pm open,type:2 0
QGB commented 3 years ago

websocket