Go to advanced search

by pfletch101
Wed Dec 04, 2019 3:00 pm
Forum: Automation, sensing and robotics
Topic: Detecting an appliance is in use
Replies: 30
Views: 665

Re: Detecting an appliance is in use

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...
by pfletch101
Tue Dec 03, 2019 4:11 pm
Forum: Automation, sensing and robotics
Topic: Detecting an appliance is in use
Replies: 30
Views: 665

Re: Detecting an appliance is in use

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...
by pfletch101
Tue Dec 03, 2019 3:33 pm
Forum: General discussion
Topic: Skype on Raspberry Pi 4
Replies: 6
Views: 914

Re: Skype on Raspberry Pi 4

Botspot wrote:
Thu Nov 28, 2019 7:48 pm
Pidgin is a universal chat client. You can install it using apt. There is a third party plugin for Skype.
Does Pidgin support video chat/conferencing?
by pfletch101
Tue Nov 26, 2019 1:51 am
Forum: General discussion
Topic: Rebooting some old version!??!
Replies: 8
Views: 227

Re: Rebooting some old version!??!

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...
by pfletch101
Mon Nov 25, 2019 11:18 pm
Forum: General discussion
Topic: Rebooting some old version!??!
Replies: 8
Views: 227

Re: Rebooting some old version!??!

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...
by pfletch101
Mon Nov 25, 2019 10:32 pm
Forum: General discussion
Topic: Rebooting some old version!??!
Replies: 8
Views: 227

Re: Rebooting some old version!??!

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 ...
by pfletch101
Fri Nov 22, 2019 10:16 pm
Forum: Python
Topic: Flask seems to be running under Python 2 - ?Solved
Replies: 7
Views: 244

Re: Flask seems to be running under Python 2

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...
by pfletch101
Thu Nov 21, 2019 2:00 pm
Forum: Python
Topic: Flask seems to be running under Python 2 - ?Solved
Replies: 7
Views: 244

Re: Flask seems to be running under Python 2

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...
by pfletch101
Thu Nov 21, 2019 4:11 am
Forum: Python
Topic: Flask seems to be running under Python 2 - ?Solved
Replies: 7
Views: 244

Re: Flask seems to be running under Python 2

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...
by pfletch101
Wed Nov 20, 2019 10:55 pm
Forum: Networking and servers
Topic: Accessing an 'external' ad hoc network
Replies: 0
Views: 60

Accessing an 'external' ad hoc network

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...
by pfletch101
Wed Nov 20, 2019 10:47 pm
Forum: Python
Topic: Flask seems to be running under Python 2 - ?Solved
Replies: 7
Views: 244

Re: Flask seems to be running under Python 2

"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...
by pfletch101
Tue Nov 19, 2019 11:56 pm
Forum: Python
Topic: Flask seems to be running under Python 2 - ?Solved
Replies: 7
Views: 244

Flask seems to be running under Python 2 - ?Solved

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...
by pfletch101
Mon Nov 18, 2019 4:50 pm
Forum: Python
Topic: Pause a program in python
Replies: 7
Views: 277

Re: Pause a program in python

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...
by pfletch101
Mon Nov 18, 2019 4:03 pm
Forum: General discussion
Topic: What would it take? Vehicle HVAC controls
Replies: 2
Views: 133

Re: What would it take? Vehicle HVAC controls

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 ...
by pfletch101
Sun Nov 17, 2019 2:10 am
Forum: Advanced users
Topic: Access to GPIO connector in a Flirc Case
Replies: 17
Views: 2440

Re: Access to GPIO connector in a Flirc Case

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...
by pfletch101
Tue Nov 12, 2019 2:01 am
Forum: Graphics, sound and multimedia
Topic: Recorder Based Pipe Organ
Replies: 4
Views: 209

Re: Recorder Based Pipe Organ

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...
by pfletch101
Fri Nov 08, 2019 10:51 pm
Forum: Advanced users
Topic: Writing to SQLIte database from multiple processes
Replies: 10
Views: 342

Re: Writing to SQLIte database from multiple processes

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...
by pfletch101
Fri Nov 08, 2019 10:48 pm
Forum: Advanced users
Topic: Writing to SQLIte database from multiple processes
Replies: 10
Views: 342

Re: Writing to SQLIte database from multiple processes

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...
by pfletch101
Fri Nov 08, 2019 9:51 pm
Forum: Advanced users
Topic: Writing to SQLIte database from multiple processes
Replies: 10
Views: 342

Re: Writing to SQLIte database from multiple processes

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...
by pfletch101
Fri Nov 08, 2019 3:55 pm
Forum: Advanced users
Topic: Writing to SQLIte database from multiple processes
Replies: 10
Views: 342

Re: Writing to SQLIte database from multiple 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...
by pfletch101
Thu Nov 07, 2019 11:56 pm
Forum: Advanced users
Topic: Writing to SQLIte database from multiple processes
Replies: 10
Views: 342

Writing to SQLIte database from multiple processes

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...
by pfletch101
Thu Nov 07, 2019 11:46 pm
Forum: Python
Topic: SOLVED - Frustrating problem with python code in Flask application
Replies: 4
Views: 205

Re: SOLVED - Frustrating problem with python code in Flask application

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...
by pfletch101
Thu Nov 07, 2019 9:20 pm
Forum: Python
Topic: SOLVED - Frustrating problem with python code in Flask application
Replies: 4
Views: 205

Re: SOLVED - Frustrating problem with python code in Flask application

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...
by pfletch101
Thu Nov 07, 2019 3:48 pm
Forum: General discussion
Topic: Interesting interview with Eben in Physics World
Replies: 41
Views: 1788

Re: Interesting interview with Eben in Physics World

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...

Go to advanced search