Current should only flow in the gnd cable under fault conditions (and then usually only very transiently, until the breaker or fuse blows!). There is thus no reason to include the gnd cable in a current sensor if you choose to monitor the return current. Where I am located only true for RCD/GFI ins...
Note it's quite easy to split a typical 2 wire lamp cord to clamp one of the wires. Even with 3 wire cables it's not hard to separate out the individuals. In that case you do have to make sure to use the live wire as trejan mentions or make sure to pair the other two (neutral & gnd) and treat as on...
There is no more (or less, or different) problem with using a (mains-side) power switch timer on 'sensitive electronics' than there is in turning them on or off by means of any other sort of power switch. I disagree. Inrush current causing cumulative stress in components is a known problem. It will...
When the cost of running 24/365 is less than five quid, there's no point in powering things off unless your power company cuts the supply (as they did to me for 12,466 seconds last night). My 'workhorse' Pi does run 24/7/365, but it is doing things on the same continuous basis. It is on a mains UPS...
You shouldn't use a power switch timer on any sensitive electronics. The continual on/off cycling is very rough on components due to the initial inrush. You risk damaging the power supply and the Pi. The abrupt power loss can cause corruption to your SD card because it wasn't shutdown cleanly. You ...
It looks as if the problem was some sort of basic misconfiguration in the system - presumably resulting from something I had done with or to the Pi in the past. After bashing my head against the wall for a bit longer, I decided to start from scratch with a new Raspbian installation. After setting th...
Another good thought, but none of my code files have shebangs (since they are not executed directly, but either imported by others or loaded by Flask), and, again, the entire flask application tree was copied from the Debian VM, on which it is running under Flask without problems. To be causing this...
not a Flask expert (unless it has whisky in it) but: what user does Flask run under? Your venv is likely only available to the Pi user, so if Flask is using sudo or going under another user, it'll pick up the system Python's definition of python2 or python3 A good thought, but this should apply equ...
I have a fairly old IoT device that sets up an adhoc WiFi network when reset - you then access a couple of web pages on it to set it up. Windows is (unsurprisingly) hopeless for this, since it adamantly 'protects' you from such networks. I had hoped that I could use one of my Pis to connect to it, b...
"python" still refers to Python 2 on Buster. You are right, of course, under normal circumstances - on both systems. However (and this is why I was confused) it appears that if you invoke python in a venv environment that was created by python3 , you get python3. On my Windows system VM, I am withi...
I have developed a Flask Application in a Debian Buster 64 VM on my main (Windows) system, with the intention of running it in 'production' on my Pi 3B. It has been debugged and runs without problems on the Debian system (on which I note that the default Python version is 3.7.3 - as it apparently no...
I think that you need to try to find out the real reason why your program is exiting/failing. I don't think that the problem is how it is pausing/sleeping. I have a number of 24/7 services that use time.sleep() to pause execution for long periods of time (more than 12 hours for some of them), withou...
I'd assume the HVAC controls would just be like anything else in the car. Either 12volt on or off, or a variable voltage sensor. I agree with topguy. Without knowing how the HVAC system controls work, you are likely to have major problems interfacing with them in a way that won't damage or destroy ...
pfletch101, You say that you got one of the Octopart ribbon cable GPIO extender cable to suit a Pi 4 in a Flirc case? I'm looking for the female to male type but struggling to identify it from the Octopart product list - if you got the male to female sort, what type number was yours? I'm afraid tha...
Thanks for the input. You are totally correct in your assessement. After posting I stumbled accross a python module called MIDO this decodes MIDI files (and does a lot of other things). Now I've seen inside the file I think it may be easier than I orignially thought. As you said the file contains a...
Or maybe use a database that does have row level locking? e.g. postgresql Indeed, but it is overkill for most of the things I do with my Pis. If I want a server-based DB manager, I tend to use Mariadb, because I have worked a lot with MySQL in the past, but if I hadn't, I would probably go to postg...
Transactions would solve the problems you listed. Read https://www.sqlite.org/lockingv3.html#transaction_control No, I don't think so. If Process A and Process B both read the same record (permitted, because neither has tried to write to the database yet), they can each sequentially proceed to subm...
Thanks for pointing out that SQLite implements internal file-based locking. For my purposes, that is probably enough, though the FAQ rather glosses over the situations where it is not enough and record-based locking (which SQLite does not implement) is required. If all the multiple writing processes...
You should safe if you implement access to the database with a mutex. While you have the mutex you need to perform the SQL statement and then commit (if writing), and then release the mutex. /Mogens I normally leave a connection to the database and a cursor open while my application is running - on...
I know that, under normal circumstances, SQLite databases can have multiple readers but only one writer. Can the 'only one writer' rule be relaxed if any potential writers share a semaphore or similar means of interprocess communication in such a way as to prevent multiple writing attempts at the sa...
Although I haven't seen your code and my apologies if I am wrong, but I expect you were doing something like this : Well, not quite. :) Here is a copy of the relevant parts of the corrected Class. I was vaguely aware of the issue, which is why the original code contains the extra assignment to a te...
The explanation for the weird behavior was that the contents of the fields['pattern'] array was being changed when I changed the corresponding setting in the mypattern Class instance, so, by the time the code got to testing it, it was the same as the relevant setting from request.form. Because of th...
Personally I think one can expect ones data to go missing on an abrupt power down. Or at least very recent versions of it. But if the operating system won't boot after such an event that is a bug. A design flaw. In the same way I expect my car to restart after running out of gas when I put some mor...