I've just received my huzzah feather esp8266 board and managed to connect through Arduino and now mpfshell. I can connect through web socket and load files, or run simple python scripts directly from the >>> prompt. But I am trying to run Dave Hyland's I2C LCD https://github.com/dhylands/python_lcd/ ... cd_test.py without success. The issue is loading the module:
from esp8266_i2c_lcd import I2cLcd
I don't know where this module should be to get loaded from. For normal python scripts (on my desktop), the modules are installed in the correct directory via pip or apt install (linux). But where should the module be for python running on the esp2866? I have tried to put it in the same directory as boot.py on the chip but that also didn't work.
Can anyone clarify? I'm sure it is straightforward, but ...
how to import esp8266_i2c_lcd.py
Re: how to import esp8266_i2c_lcd.py
You should put the library in the /lib folder.
But on different devices / builds the system rootpath is different, on the esp8277 version 1.8.7 this folder is in the root i.e:
On later builds and on other devices such as pyboard, the system rootpath is /flash
so in that case it would be :
If the lib folder does not exist you can create it.
If you want to see which folders are in the search path:
But on different devices / builds the system rootpath is different, on the esp8277 version 1.8.7 this folder is in the root i.e:
Code: Select all
/lib
so in that case it would be :
Code: Select all
/flash/lib
If you want to see which folders are in the search path:
Code: Select all
import sys
sys.path
>> ['', '/lib', '/']
Re: how to import esp8266_i2c_lcd.py
You also need to copy the lcd_api.py file to the device.