Search found 46 matches

by fstengel
Thu Mar 19, 2020 4:26 pm
Forum: General Discussion and Questions
Topic: Confusion about micropython.const
Replies: 4
Views: 173

Re: Confusion about micropython.const

Look there: http://docs.micropython.org/en/latest/reference/speed_python.html#the-const-declaration As far as I can tell, when you write foo=const(42) then foo is not a variable but behaves as if, as compile time, it is replaced by 42 . So your code would be seen as: from micropython import const cl...
by fstengel
Wed Mar 04, 2020 12:56 pm
Forum: ESP32 boards
Topic: ESP32 network activation resets the board
Replies: 5
Views: 250

Re: ESP32 network activation resets the board

This could almost become part of a FAQ. There are quite a few questions in the forum on the same issue (amonst them one of mine :oops:)
by fstengel
Wed Mar 04, 2020 12:53 pm
Forum: General Discussion and Questions
Topic: ubluetooth - async ? 'BLE' object isn't iterable
Replies: 22
Views: 1005

Re: ubluetooth - async ? 'BLE' object isn't iterable

Diclaimer: I'm not an uasyncio specialist. However, a couple of things look weird in your code. You want to use the singleton BLE object, you do not need to wait for it: it does already exist. So no need for await in the line initializing ble . This is why your coro does not work: you try to wait fo...
by fstengel
Sun Mar 01, 2020 9:21 am
Forum: ESP32 boards
Topic: BLE Active Exception problem
Replies: 3
Views: 186

Re: BLE Active Exception problem

As far as I can tell, the exception is not thrown by MicroPython, but by the part that is used by VS and its plugin to communicate with your ESP32. One possible reason for your issue is your chip resetting because of a brownout due to the RF part of the chip being activated. I had that problem with ...
by fstengel
Fri Feb 14, 2020 8:36 am
Forum: General Discussion and Questions
Topic: How to combine bytearrays fast ?
Replies: 14
Views: 526

Re: How to combine bytearrays fast ?

I just tried using the viper emitter on my ESP32. It seems that range(240) is strongly optimized. The following three functions @micropython.viper def merge3(a:ptr8, b:ptr8, c:ptr8, d:ptr8, result:ptr8)->ptr8: iteration_list = range(0,240) for i in iteration_list: j = int(i) result[j] = a[j] + b[j] ...
by fstengel
Tue Feb 11, 2020 9:45 am
Forum: ESP32 boards
Topic: unable to include .h files from ESP-IDF components directory
Replies: 2
Views: 154

Re: unable to include .h files from ESP-IDF components directory

Just an idea, have you tried the following snippet: #include esp_adc_cal/esp_adc_cal.h This mirrors what happens for rmt: one includes driver/rmt.h which actually includes the file found at component/driver/include/rmt.h in the esp-idf folder. I cannot test this at the moment, so this is just an ide...
by fstengel
Wed Feb 05, 2020 2:35 pm
Forum: General Discussion and Questions
Topic: local variable referenced before assignment
Replies: 8
Views: 433

Re: local variable referenced before assignment

Another way to globally access data without having to resort to local/global is by using objects. class AnObject: def __init__(self): self.data = 0 def set(self, o): self.data = o def get(self): return self.data ob = AnObject() def test1(): ob.set(32) def test2(): if ob.get()==32: print("Test 1 done...
by fstengel
Mon Feb 03, 2020 1:15 pm
Forum: ESP32 boards
Topic: M5Atom
Replies: 8
Views: 388

Re: M5Atom

That reminds me: why does one brown out (matrix) and not the other (lite)? Is it because there is an IMU added?
by fstengel
Mon Feb 03, 2020 1:11 pm
Forum: ESP32 boards
Topic: M5Atom
Replies: 8
Views: 388

Re: M5Atom

Something else to check first - when the radio is active the ESP32 draws the most amount of current. It can sometimes spike to above 500mA and can reset if the power supply is inadequate. So perhaps quickly try a different USB power source and possibly even cable... Shame on me :oops:. It was the c...
by fstengel
Mon Feb 03, 2020 7:09 am
Forum: ESP32 boards
Topic: M5Atom
Replies: 8
Views: 388

Re: M5Atom

Well, this is as I feared: I must have a faulty board. I tried with older versions (1.10 an 1.10) and got the same sequence: reboot when activating the RF part. >>> wlan.active(True) W (41515) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration ets Jun 8 2016 00:2...