Rotary Encoder Module Causes Restart #7142
Replies: 1 comment
-
Posted at 2019-04-18 by hungryforcodes This code works perfectly fine on the ESP8266, btw. -hfc Posted at 2019-04-18 by @allObjects Feels like a jitter to me, caused may be by auto-flipping pin modes... Try to set pin mode before using the pins... ESP826, ESP32 and the various STMs are all different hardware. The GPIO HW and how the are 'operated' have impact on Espruino behavior. Posted at 2019-04-19 by hungryforcodes No, we've been through this before here: http://forum.espruino.com/conversations/325755/ I can wire up an ESP8266 to a rotary encoder and spin it as fast as I can, and nothing bad happens like a reset. Using this code:
I can do this as long as I want. True I get a "New interpreter error: FIFO_FULL" error, but it doesn't affect anything.
So this is about a clear difference between the ESP8266 and the ESP32. It works on the ESP8266, it doesn't on the ESP32. -=hfc Posted at 2019-04-23 by @gfwilliams Have you tried using different pins? Posted at 2019-04-27 by hungryforcodes No. I haven't -- and that's a good idea! I'll try this out and report back. Posted at 2019-05-02 by hungryforcodes I tried it out and it worked (rotation with no crashing). However after, I started adding some intervals for other stuff and the quality of the readings degraded significantly -- it couldn't really figure out when a rotation was happening or not. I would spin it, and the value wouldn't change, but sometimes it would -- kind of unreliable. I guess this is because its using software interrupts? For my build the encoder is important, so I'll probably dedicate a small mcu like an ATTINY85 or an ESP-01 with Arduino on it, just to read the rotation. Then feed that into my ESP32. Posted at 2019-05-02 by @allObjects @ungryforcodes
The right choice... ESP32's underlaying OS / layer (underneath Espruino) to connect to HW interrupts is what's messing with you - my wild guess. R is not always real (Time), especially when the application is not implemented within it. Posted at 2019-05-03 by hungryforcodes Yeah I think the ESP32 SDK has been going a bit weird lately -- and you're right its becoming increasingly hard to build something reliable on top of it. Its a bit strange that at version 3 -- Espressif is still introducing breaking changes to their API etc. I also get lots of memory errors and failures when doing http / https requests. Anyways lets hope as the SDK matures things will get sorted out. Posted at 2019-05-03 by JumJum Just found translation "disimprove" for the german "verschlimmbessern" Posted at 2019-05-03 by @allObjects @jumjum, machtest du einen falschen Fehler?... wrong error.. goes into the same category. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-04-18 by hungryforcodes
Hey Gang,
I know there have been a few goes in Github around the "watch" function (which the rotary encoder module uses behind the scenes), on the ESP32, and generally it works fine for buttons. But when using a full encoder module, such as this one:
https://www.ebay.com/p/5pcs-Ky-040-Rotary-Encoder-Module-for-Arduino-AVR-Pic/1386840178
I get continual restarts on 2v01 (it was the same on previous versions, so its not a regression).
So lets take the standard code from the Espruino example page :
https://www.espruino.com/Encoder
What this causes on my ESP32s is basically this:
.. and these restarts continue until I stop rotating the encoder, after which the ESP32 restarts a last time and continues normal functioning. So any ideas?
Thanks :)
-=hfc
Beta Was this translation helpful? Give feedback.
All reactions