MicroPython on ESP32 with SPIRAM support

joicetm
Posts: 15
Joined: Mon Apr 10, 2017 12:47 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby joicetm » Fri Sep 29, 2017 8:03 am

thanks for all the good work :)

I was using idf 2.0 and now i have updated the idf to release 2.1
But none of the example codes are not working, ie.. i am able to compile the code and flash it to the board. but it shows some hex values on the terminal.
what am i missing?
current version of esptool is : esptool.py v2.1 - ESP8266 ROM Bootloader Utility

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby loboris » Fri Sep 29, 2017 9:21 am

joicetm wrote:thanks for all the good work :)

I was using idf 2.0 and now i have updated the idf to release 2.1
But none of the example codes are not working, ie.. i am able to compile the code and flash it to the board. but it shows some hex values on the terminal.
what am i missing?
current version of esptool is : esptool.py v2.1 - ESP8266 ROM Bootloader Utility
This MicroPython implementation is based on the latest esp-idf master branch and xtensa toolchain.
The GitHub repository includes both esp-idf and xtensa toolchain packed in xz archives (in Tools directory).

As the first step after cloning the repository, you should run ./BUILD.sh menuconfig in MicroPython_BUILD directory. This will unpack the esp-idf and toolchain for your platform and create initial sdkconfig.

If, after flashing, you get "some hex values on the terminal", you have probably set the wrong value for XTAL frequency (→ Component config → ESP32-specific → Main XTAL frequency). Set it to the crystal which is used on your board. Most boards use 40MHz crystal, some use 26MHz crystal.

nissim@TelnT.com
Posts: 4
Joined: Fri Jun 02, 2017 10:19 am

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby nissim@TelnT.com » Wed Oct 11, 2017 11:24 pm

In the MicroPython ESP32_LoBo_v2.0.4 it seems that main.py is not flashed to ESP32
only boot.py exist on esp32

(132) intr_alloc: Connected src 34 to int 3 (cpu 1)[0m
Reset reason: Power on reset Wakeup: Power on wake
D (142) intr_alloc: Connected src 22 to int 4 (cpu 1)[0m
OSError: [Errno 2] ENOENT
MicroPython ESP32_LoBo_v2.0.4 - 2017-10-08 on ESP32 board with ESP32
Type "help()" for more information.
>>>
Is that a bug ?
Dr. Nissim Zur
Consultant design house for Artificial Intelligence
Internet of Things ("IoT") wireless devices.

http://www.TelnT.com
nissim@TelnT.com

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby loboris » Thu Oct 12, 2017 7:51 am

nissim@TelnT.com wrote:In the MicroPython ESP32_LoBo_v2.0.4 it seems that main.py is not flashed to ESP32
only boot.py exist on esp32
...
Is that a bug ?
It is not a bug.
It is up to the user to create main.py if it is needed.

The existence of the main.py could be checked on boot so that the OSError: [Errno 2] ENOENT is not printed. I'll look at it.

bdespatis
Posts: 1
Joined: Fri Oct 20, 2017 8:08 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby bdespatis » Fri Oct 20, 2017 8:23 pm

Thank you for your work. You have the only working firmware for our needs. I was not able to send you a PM on either GitHut or this forum. Can I ask your contact information (through MP), I would like to work with you for business purpose. Let me know how I can sponsor your work.

Regards,
Benoit Despatis, P.Eng.

Headless
Posts: 2
Joined: Mon Oct 23, 2017 12:52 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby Headless » Mon Oct 23, 2017 1:38 pm

Great work :D

I think that i might have found a bug though. When I use the following code I cant set the DNS address for some reason.

Code: Select all

import network
import time
sta_if = network.WLAN(network.STA_IF)
sta_if.ifconfig(("192.168.1.123", "255.255.255.0", "192.168.1.1", "192.168.1.1"))
sta_if.active(True)
print("Connecting to WiFi...", end='')
sta_if.connect("APname", "APpassword")
while not sta_if.isconnected():
    print(".", end='')
    time.sleep(0.5)

print("done.")
When I check the DNS now I get this response:

>>> sta_if.ifconfig()
('192.168.1.123', '255.255.255.0', '192.168.1.1', '0.0.0.0')

Can anybody confirm this bug or have i messed up the configuration somehow?

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby loboris » Tue Oct 24, 2017 1:18 pm

Headless wrote:...
I think that i might have found a bug though. When I use the following code I cant set the DNS address for some reason...
There was a bug in network module and it was also not supported in esp-idf.

The today's commit fixes this issue and setting static IP and DNS works as expected.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: MicroPython on ESP-WROVER with 4MB of psRAM

Postby loboris » Tue Oct 24, 2017 2:20 pm

:!: Update
  • esp-idf updated to the latest master branch commits
  • added gsm module
    • PPPoS support, all network functions works the same as with WiFi
    • connect and disconnect methods to go online/offline
    • SMS support, delete, send or read received messages, on_sms_received callback
    • execute any AT command and get the response, even the complex commands like send message or read from filesystem (Simcom) are supported. You can easily build complex python script to execute any sequence of AT commands.
    • WiFi in AP mode can be used while connected to the Internet via GSM/PPPoS
  • display module updated
    • added support for STMPE610 touch controller (as on Adafruit TFT FeatherWing)
    • added touch calibration tpcalib frozen module
    • added paint module in examples folder
  • fixed bug in i2c functions ssd1306 frozen module
  • added support for NVS memory (to machine module). NVS variables are preserved if power is removed. Available methods:
    • nvs_setint store integer (up to 32bit) to nvs storage
    • nvs_getint retrieve integer from nvs storage
    • nvs_setstr store string to nvs storage
    • nvs_getstr retrievi string from nvs storage
    • nvs_erase erase variable from nvs storage
    • nvs_erase_all erase the whole nvs storage area
  • some fixes and improvements in neopixel module
  • updated logging.py frozen module
  • fixed setting static IP and DNS in wifi STA mode
  • fixed ftp server not working in AP mode
  • some improvements in BUILD.sh script
  • many improvements, additions and bugfixes in various modules
Documentation will be pushed in the following days.

You can support this project by donating via PayPal

Headless
Posts: 2
Joined: Mon Oct 23, 2017 12:52 pm

Re: MicroPython on ESP32 with SPIRAM support

Postby Headless » Tue Oct 31, 2017 7:35 am

Thanks for fixing the ifconfig function.

But DNS still doesnt work for me:

Code: Select all

>>> sta_if.isconnected()
True
>>> sta_if.ifconfig()
('192.168.1.123', '255.255.255.0', '192.168.1.1', '8.8.8.8')
>>> import socket,usocket
>>> print(socket.getaddrinfo("www.google.de", 80))
[]
>>> print(usocket.getaddrinfo("www.google.de", 80))
[]
>>>


I also tried to use my router as DNS server but that didnt work either. Normal IP addresses seem to work.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: MicroPython on ESP32 with SPIRAM support

Postby loboris » Wed Nov 01, 2017 1:42 pm

:!: Update
  • Updated gsm module
  • gsm module documentation added
  • Updated network and socket modules, fixed static DNS bug
  • implement network.LAN() object for wired PHY objects (from main MicroPython port, not tested)
  • Building the firmware does not update files in 'firmware' directory, fixes 'git pull' problems
  • esp-idf updated to the latest commit (79f206be47c3f608615c1de8c491107e6c9194bb)
  • Other small bugfixes and improvements
Full gsm module documentation is now available.
Headless wrote:... But DNS still doesnt work for me ...
It is working now.

Who is online

Users browsing this forum: No registered users and 10 guests