Search found 42 matches

by ghayne
Sun Sep 01, 2019 8:21 pm
Forum: General Discussion and Questions
Topic: Simple scenario with button/IRQ/write to file that leads to ESP crash + FS coruption
Replies: 6
Views: 3756

Re: Simple scenario with button/IRQ/write to file that leads to ESP crash + FS coruption

def irqHandler(pin):
micropython.schedule(sch, None)

You are calling sch before it is defined!
by ghayne
Thu Aug 29, 2019 6:32 pm
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Re: Inconsistent results measuring pulses

Thank you for your input Peter. I have discovered that my cheap photo sensor is not the best solution for detecting pulses and I am currently waiting for delivery of a BPW34 Photodiode to try and correct this.
by ghayne
Fri Aug 23, 2019 1:33 pm
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Re: Inconsistent results measuring pulses

Danke Roberthh!
by ghayne
Fri Aug 23, 2019 8:24 am
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Re: Inconsistent results measuring pulses

That's certainly how I would do it. Have a trivial interrupt handler which increments a global. The main code runs a loop which: Clears down the global. Pauses for (say) one minute. Reads the value of the global. Calculates the power and publishes the result. There are possible improvements to acco...
by ghayne
Fri Aug 23, 2019 8:10 am
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Re: Inconsistent results measuring pulses

jimmo wrote:
Fri Aug 23, 2019 12:05 am
Also, another thought. At the moment your detection code is tied up with the publishing code, so a delay in one will affect the other.
Yes jimmo, that bit needs some work too. Thanks for the input.
by ghayne
Thu Aug 22, 2019 9:17 pm
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Re: Inconsistent results measuring pulses

This is on an ESP8266. That would explain the observed behaviour completely, a double trigger would halve the time. Is there a way to overcome this, A Schmitt trigger?
by ghayne
Thu Aug 22, 2019 5:28 pm
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Re: Inconsistent results measuring pulses

Thinking about it further, garbage collection would slow down the process which would result in a lower rather than a higher reading! :o
by ghayne
Thu Aug 22, 2019 1:49 pm
Forum: General Discussion and Questions
Topic: Inconsistent results measuring pulses
Replies: 12
Views: 8935

Inconsistent results measuring pulses

I have put together some code to read the pulses from an electricity meter. I have been testing it using a flashing LED. Mostly the results are constant, as they should be but occasionally I get two readings in series that are double what they should be. Could Garbage collection be the problem? from...
by ghayne
Wed Aug 07, 2019 9:23 am
Forum: General Discussion and Questions
Topic: ESP32: How to send files from internal flash to PC
Replies: 14
Views: 15541

Re: ESP32: How to send files from internal flash to PC

Have you considered sending the data using MQTT in real time?
I am doing something similar with temperature readings, using Node-Red to receive the MQTT messages and pass them to an InfluxDB database for analysis with Grafana.
I was pleasantly surprised how easy it is to set up MQTT on MicroPython.
by ghayne
Thu Jun 13, 2019 12:32 pm
Forum: General Discussion and Questions
Topic: Increase Console Scrollback
Replies: 4
Views: 2461

Re: Increase Console Scrollback

Thank you for the quick reply anyway. I am a Linux user and am spoiled by the long history. Also I am lazy :)
I've just started with Micropython and am having the time of my life!
I also saw that you are from a country I lived in for 33 years, so shoene Gruesse aus Wales.