access via SSH?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: access via SSH?

Post by deshipu » Thu Jun 16, 2016 7:29 pm

Thank you, that looks good, still no idea what might be wrong.

pythonista
Posts: 16
Joined: Sun Jun 12, 2016 4:51 pm

Re: access via SSH?

Post by pythonista » Thu Jun 16, 2016 7:38 pm

does it matter that I use witty esp8266? :roll:

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: access via SSH?

Post by deshipu » Thu Jun 16, 2016 7:39 pm

We all use ESP8266 here.

pythonista
Posts: 16
Joined: Sun Jun 12, 2016 4:51 pm

Re: access via SSH?

Post by pythonista » Thu Jun 16, 2016 8:25 pm

yes but maybe differnt amount of ram? i'll try to compile newer version if it exists...

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: access via SSH?

Post by patvdleer » Thu Jun 16, 2016 9:13 pm

pythonista wrote: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

I had the same issue, looks like you are missing a part of the default py files in scripts, I rebuilt the image, make clean && make and redeployed it which mixed the issue for me.

Since there is a problem with the inisetup.py file the vfs isn't setup/loaded which may explain your problems.
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

pythonista
Posts: 16
Joined: Sun Jun 12, 2016 4:51 pm

Re: access via SSH?

Post by pythonista » Thu Jun 16, 2016 11:02 pm

I have recompiled to latest esp version:

Code: Select all

MicroPython v1.8.1-55-g332545b on 2016-06-16; ESP module with ESP8266
but same problem...

Code: Select all

Traceback (most recent call last):
  File "webrepl_setup.py", line 71, in handle_conn
OSError: [Errno 19] ENODE
looking at line 71

Code: Select all

    with open("port_config.py", "w") as f:
        f.write("WEBREPL_PASS = %r\n" % passwd1.decode("ascii"))
but I cannot see port_config.py file ? maybe it is missing/"not writable"?

if I try:

Code: Select all

>>> import os
>>> os.listdir()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
>>> 
it looks like no file system? device is Witty Cloud (ESP12F)

pythonista
Posts: 16
Joined: Sun Jun 12, 2016 4:51 pm

Re: access via SSH?

Post by pythonista » Fri Jun 17, 2016 12:05 am

finally solved it! I was using :
../Library/Arduino15/packages/esp8266/tools/esptool/0.4.8/esptool

instead of:

../esp8266-micropython-vagrant/esptool/esptool.py

thnx 2 all ;)

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: access via SSH?

Post by jms » Fri Jun 17, 2016 11:35 am

The SSH protocol is incredibly heavyweight, an order of magnitude more than what you would want to try running on this board.

It would be better to use a VPN to get onto the network then good old telnet.

In fact the same could be said of TLS/SSL and using external cloud services. It's much easier to talk to something on the local network without it.

Jon

User avatar
patvdleer
Posts: 46
Joined: Mon Jun 13, 2016 11:52 am
Location: Maastricht, NL, Europe
Contact:

Re: access via SSH?

Post by patvdleer » Fri Jun 17, 2016 3:17 pm

pythonista wrote: ...

Code: Select all

>>> import os
>>> os.listdir()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
>>> 
You should look into vfs, help(vfs) which should show you at least _boot.py
NodeMCU v0.9 / V1 / V2 / V3
WeMos D1 Mini
WeMos Lolin32 v1.0.0
WeMos Lolin D32 Pro V2

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: access via SSH?

Post by pfalcon » Fri Jun 17, 2016 8:02 pm

jms wrote:
In fact the same could be said of TLS/SSL and using external cloud services. It's much easier to talk to something on the local network without it.

Jon
These are golden words and exactly mirror outlook of the maintainers (well, mine for sure). SSL/TLS is pretty tricky thing, and even big boxes have problems with it, remember or Heartbleed, or at my dayjob, we had intermittent TLS failures for last 2 months and suspected everything up to hardware failure (somewhere at the cloud provider, as customary nowadays). Turned out it's a software issue reported some 5 years ago and marked as "Wontfix": https://bugs.launchpad.net/ubuntu/+sour ... bug/795355 . So again, if "big iron" has problems with it, just imagine what problems small embedded systems have. We provide basic SSL support which works for basic things. I'm ready to go as far as possible beyond that, up to developing own TLS implementation. But before going that deep (can easily take half a year), we're going to make many useful things to be available which should work pretty well in your local network, protected by WPA.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply