Replies: 18 comments 21 replies
-
|
With Tasmota, you can get by without any programming, as a starting point. If configure a counter gpio (assuming electrical compatibility), Tasmota can count pulses. If you set a telemetry period of one minute, along with You can collect data backend, or with ESP32, you have the Berry language where you could code some aggregation in local files. Whatever you do for the HV setting is up to how the hardware for that works. |
Beta Was this translation helpful? Give feedback.
-
|
It looks like there is more discussion than what I expected from not finding "Geiger" in the Deice repository :-) Your suggestions sounds very manageable. I do have the hardware which creates the logic pulses, and the ESP32 Dev Kits. It sounds like I can use some generic Tasmota? Where do I find this and hopefully guidance on how to install it on an ESP32? And also guidance on compiling, preferably on vscode? |
Beta Was this translation helpful? Give feedback.
-
|
The readme of this repo has all those infos and links to more details. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
HTTP is not the culprit. I stopped all programs interacting with Tasmota by any means, and look at the Console. I let the counter run freely, without resetting, and issued TelePeriod 10. The signal generator was set at 1.000000 kHz. (It is stable; its jitter may be in the milliHertz region.) This is what the console showed:
The counts equate to an average of 1755 counts per second and a scatter from 1590 to 1960! It should be 1000 and a scatter of zero! There is no HTTP involved. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the code. I managed to upload and execute it, and the console now shows like But how can I read these ticks-lines into my Python program? Is it possible to create this code within my Python code, and send it to Tasmota as a string? or as bytes? like I send 'status 10' for data? |
Beta Was this translation helpful? Give feedback.
-
|
That version is very helpful, thanks. It was then easy to add a data log file 'history.csv', which now sits in the flash storage. Great. My browser told me that I can download it with ' http://:80/ufsd?download=/history.csv'. Even better; amazing what Berry can do. But documentation is a weak spot in Tasmota & Berry :-(. Hard to find answers. For example, to delete my History file it doesn't help to define a function and call it. As the class counterticks works so well, is it a MUST to always create classes, or are there simpler ways? |
Beta Was this translation helpful? Give feedback.
-
|
Indeed, makes it simpler. I now use: I am surprised that Could I do the same thing with you I wouldn't mind having all the code sitting in my Python code. Because then I wouldn't have to explain to the users how to upload Berry code to the ESP32 :-/. |
Beta Was this translation helpful? Give feedback.
-
|
I agree, it is mostly better to use the built-in fucntions. Here it would have to be:
But so far the outcome from Berry is the same. I am wondering what the function for filesize is? I can't find any, and my work around is to read the whole file and 'size()' its length. Is there really none? |
Beta Was this translation helpful? Give feedback.
-
|
My preference is to define the functions running on the ESP32 by sending those as http commands from Python, as "br xyz". And ran into the weirdest problems. First, the url is When But I had the weirdest problems running it. The super-weirdest: Adding values from a list does not work! I make a list of the last 60 CPS values, so the sum of it, done in def getCPM, is a CPM value. I rebooted the ESP, called Status, called Time ( to get milliseconds), and uploaded Look at the last 5 lines: for the 3rd second getCPM walks through index 0, 1, 2 with CPS 40, 34, 38, yet returned as CPM is NOT the sum of it (=112), instead it is the oldest CPS recorded (=38)? Huh? |
Beta Was this translation helpful? Give feedback.
-
|
When I save the very same The last 5 lines show that the sum of the last 3 CPS (34, 42, 0) is indeed the correct CPM (76)! |
Beta Was this translation helpful? Give feedback.
-
|
The catch here is what http thinks that legal character are. And '+' is one reserved for itself, it is used to replace a space character (but '%20' can also be used). So a '+' sign, when used to sum things up, must then also be '%'-encoded as '%2B'. With that, it all works! Fortunately, the Google says all its url lengths are limited to 16.384 characters, as opposed to Tasmota Berry's 1600. Thanks for the list handling tip! I have also discovered that Berry has f-strings :-). Nice! |
Beta Was this translation helpful? Give feedback.
-
|
Is there a value of "nan" (Not-A-Number) in Berry? Like in Python with float("nan")? |
Beta Was this translation helpful? Give feedback.
-
|
I am basically finished with the conclusion that Tasmota is well qualified as a generic OS for Geiger counter! I am running it with real Geiger counter hardware. A more cosmetic item is left: On defining an ESP32 pin as counter (I use GPIO22) the reading of the counter is shown in the WebUI. However, in present case the counter is reset every second, and the WebUI shows reading of anything from 0 to max CPS, as it is not synchronized. This is not helpful. Rather it is irritating. I would like to either:
The WebUI seems to update every 3 se, which is ok. How can this be done? |
Beta Was this translation helpful? Give feedback.
-
|
Still struggling with the code. This is your original code posted above: The init starts with |
Beta Was this translation helpful? Give feedback.
-
|
Stuck again, this time at the template. Beginning with WebUI Configuration -> Template I can define the template. In my case I set GPIO22 to Counter, and save. Giving command 'template' I can see the newly made template, and can even send it from remote with However, this seems to still need "Activation", and none of the template xyz commands do an activation, instead they all delete my configuration. Is that really possible only manualy on the WebUI? |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
I am using a Tasmota Plug via HTTP and I am quite pleased with the ease using it. This made me consider to use the Tasmota firmware for a Geiger Counter (to measure radioactivity).
The hardware isn't very complicated: a Geiger tube, a HV (High Voltage, ~400V) generator, pulse discriminating circuitra, a pulse counter.
The software - at its bare minimum - is simple: the firmware receives a call for data, and sends CPS (Counts Per Second), the counts aquired during the last 1 sec. That's it.
In more elaborate scenarios there would be a CPM (Counts Per Minute, sum of last 60 CPS) call, a setting of the HV (300...700V), CPS/CPM storage for the last day, week, month.
I had programmed this already (in C++); it is not very difficult. But putting this in Tasmota --- where would I even start ?
Beta Was this translation helpful? Give feedback.
All reactions