Page 34 of 47

Re: MicroPython on ESP32 with SPIRAM support

Posted: Thu Feb 01, 2018 12:16 pm
by loboris
OutoftheBOTS_ wrote:
Thu Feb 01, 2018 11:57 am
Can I use 36 or 39 as SPI MISO ??
Can I use 36 or 39 as ADC input for the battery monitor??
I haven't tested it, but using pins 36 or 39 should be OK for SPI MISO.

You can use pins 36 & 39 for ADC input.
The only restriction is that if you are using the the internal hall sensor, the pins 36&39 cannot be used as regular ADC inputs.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Thu Feb 01, 2018 9:01 pm
by OutoftheBOTS_
All my programs I use a try except to catch any errors or keyboard interrupt and in the except I deint everything like SPI, PWM but haven't found any docs for releasing machine.Pin and am just setting pin.value(0), is there a way to deinit Pin??

Re: MicroPython on ESP32 with SPIRAM support

Posted: Fri Feb 02, 2018 5:48 am
by pythoncoder
Assuming this port hasn't done anything special the usual approach is to set pins to inputs so that they go high impedance.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Fri Feb 02, 2018 6:41 am
by OutoftheBOTS_
@pythoncoder Thanks :)

I am at the stage of tuning my PID control system for individual motor speed then a higher level PID to sync the 2 motors so the robot will drive straight instead of waddle like a duck.

ATM I am trying to tune by just printing the error to the screen with very ordinary results. I really need to be able to graph the error to tune much better. I though maybe just to save all the error data to a file on the ESP32 then upload to my PC then load it into excel and ask it to graph it but was wondering can anyone think of a easy way to graph it live on my PC ?? I am using a timer to read the encoders and calualte the error every 100ms and adjust the duty cycle.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Fri Feb 02, 2018 6:54 am
by pythoncoder
I think you'd get more eyes on a generic query like this if you raised it as a new topic. Not everyone is using the Loboris port. And this query is not relevant to it.

My general approach would be to use a socket for communication. The PC program would read data from the socket and plot it (possibly using asyncio). But I'm not well-versed in CPython plot modules.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Fri Feb 02, 2018 10:33 pm
by OutoftheBOTS_
@pythoncoder

Thanks for your suggestion. After googling it seems running a web-server on the ESP32 with websockets running a java script plotter client side will do the job nicely and the websockets will also allow me to make live changes to my PID gain on the ESP32.

It is going to be an interesting learning curve as I have never used sockets before, let the fun begin :)

Re: MicroPython on ESP32 with SPIRAM support

Posted: Sat Feb 03, 2018 7:06 pm
by kevinkk525
Has someone encountered an error like this before? I had nothing running except ftp server with one connected client. when I came back 3 hours later this error was seen:

Guru Meditation Error: Core 0 panic'ed (LoadProhibited)
. Exception was unhandled.
Core 0 register dump:
PC : 0x40132171 PS : 0x00060730 A0 : 0x80130b14 A1 : 0x3ffe1a20
A2 : 0x3ffe2970 A3 : 0x3ffe1a60 A4 : 0x00060720 A5 : 0x00000001
A6 : 0x00060723 A7 : 0x3ffdfce5 A8 : 0xcfffffd3 A9 : 0x00000000
A10 : 0x1100c9c9 A11 : 0x00000002 A12 : 0x00000050 A13 : 0x03333333
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x0000001c
EXCVADDR: 0x1100ca31 LBEG : 0x4009e018 LEND : 0x4009e046 LCOUNT : 0xffffffff

Backtrace: 0x40132171:0x3ffe1a20 0x40130b11:0x3ffe1a60 0x40130cb0:0x3ffe1b30 0x401378c1:0x3ffe1b60 0x400e07c3:0x3ffe1b80 0x400e146d:0x3ffe1ba0 0x400d8dde:0x3ffe1bd0

CPU halted.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Sat Feb 03, 2018 8:41 pm
by Roberthh
Depends. I had occurrences like that with one of my boards, an Wemos ESP32 Pro with a WROVER module, SPI and RAM speed set to 80 MHz. At 40 MHz is was stable, and another unit is also stable at 80 MHz.

Re: MicroPython on ESP32 with SPIRAM support

Posted: Sat Feb 03, 2018 8:57 pm
by kevinkk525
my Lolin ESP32 Pro Wrover runs at 40MHz SPI RAM speed.
Well let's hope this error won't happen again..

Re: MicroPython on ESP32 with SPIRAM support

Posted: Sat Feb 03, 2018 9:05 pm
by loboris
kevinkk525 wrote:
Sat Feb 03, 2018 7:06 pm
Has someone encountered an error like this before? I had nothing running except ftp server with one connected client. when I came back 3 hours later this error was seen:

Guru Meditation Error: Core 0 panic'ed (LoadProhibited)
...
CPU halted.
Could you run this in esp-idf monitor (./BUILD.sh monitor). That way the functions wich caused the error and the location in the source files will be visible...