Page 1 of 3
access via SSH?
Posted: Mon Jun 13, 2016 8:30 pm
by pythonista
Is it possible to connect remotely over wifi (using SSH) to my ESP8266 running Micropython?
Re: access via SSH?
Posted: Mon Jun 13, 2016 8:43 pm
by torwag
No, that would require to run an ssh server on the esp8266. For the ssh server it would need some more dependencies, it would need a shell and it would need some sort of underlyimg OS to manage all this in some way. etc. Micropython is not an OS (yet
). Thus it is unlikely that something like ssh will ever work. If you work with micropython you need to think about bare metal microcontrollers which execute a single python program.
Re: access via SSH?
Posted: Mon Jun 13, 2016 8:47 pm
by pythonista
understand totally, but I am so delighted with MicroPython that I think that remote access is the only thing missing for total happiness
)
at least telnet (if openssl is too complicated for now) would be nice... (and enable to thinker with micropython without wires...)
Re: access via SSH?
Posted: Mon Jun 13, 2016 9:52 pm
by markxr
Telnet is probably do-able with the current infrastructure in Micropython. The existing remote shell is not too different from telnet.
Re: access via SSH?
Posted: Mon Jun 13, 2016 10:20 pm
by torwag
do you know about webrepl?
Re: access via SSH?
Posted: Mon Jun 13, 2016 11:09 pm
by pythonista
yes, tried to import it but cannot see that it binds/starts listening?
Code: Select all
dhcp client start...
Performing initial setup
Traceback (most recent call last):
File "_boot.py", line 9, in <module>
File "inisetup.py", line 37, in setup
File "inisetup.py", line 9, in wifi
OSError: can't set AP config
could not open file 'boot.py' for reading
could not open file 'main.py' for reading
#4 ets_task(40100350, 3, 3fff6350, 4)
MicroPython v1.8.1-35-gdeaf071 on 2016-06-12; ESP module with ESP8266
Type "help()" for more information.
>>> ip:192.168.6.232,mask:255.255.255.0,gw:192.168.60.1
import webrepl
>>> pm open,type:2 0
Re: access via SSH?
Posted: Tue Jun 14, 2016 9:36 am
by deshipu
you need webrepl.start()
Re: access via SSH?
Posted: Wed Jun 15, 2016 10:11 pm
by pythonista
Thank you, work like a charm...
connects via web client, but it always ask for a password setup (first time setup)...
any idea why it don't save settings?
here is message from console while connecting via web script...
Code: Select all
Traceback (most recent call last):
File "webrepl_setup.py", line 71, in handle_conn
OSError: [Errno 19] ENODE
Re: access via SSH?
Posted: Thu Jun 16, 2016 8:13 am
by deshipu
Can you run "import port_diag" on your board and paste here the results?
Re: access via SSH?
Posted: Thu Jun 16, 2016 6:21 pm
by pythonista
yes, here is it:
Code: Select all
>>> import port_diag
FlashROM:
Flash ID: 1640e0 (Vendor: e0 Device: 4016)
Flash bootloader data:
Byte @2: 00
Byte @3: 40 (Flash size: 4MB Flash freq: 40MHZ)
Networking:
STA ifconfig: ('192.168.60.232', '255.255.255.0', '192.168.60.1', '192.168.60.1')
AP ifconfig: ('0.0.0.0', '0.0.0.0', '0.0.0.0', '192.168.60.1')
Free WiFi driver buffers of type:
0: 8
1: 0
2: 8
3: 4
4: 7
lwIP PCBs:
Active PCB states:
Listen PCB states:
TIME-WAIT PCB states:
>>>