Go to advanced search

by Gerymake
Wed Jun 19, 2019 9:13 pm
Forum: Python
Topic: When is custom error handling necessary
Replies: 3
Views: 309

Re: When is custom error handling necessary

Are the errors recoverable or does it always result in a program restart needed? Does making a "custom error" tell you anything you don't already know? Who's going to see the error? You? A sysadmin? An end-user? Yes, they are. When I get an exception the program can keep working, it just omits cert...
by Gerymake
Wed Jun 19, 2019 1:07 pm
Forum: Python
Topic: When is custom error handling necessary
Replies: 3
Views: 309

When is custom error handling necessary

I am using several sensors for a garden automation project. I have been handling errores the "straightforward way". Imagining hypothetical situations and then creating an exception for the error the program raises, is this the a decent approach? I am extremely confused abou custom errors. I have gon...
by Gerymake
Tue Jun 18, 2019 10:02 am
Forum: Python
Topic: Importing python code from a sub-folder
Replies: 6
Views: 328

Re: Importing python code from a sub-folder

Looks like a good idea but it may be too complex, I am not very used to coding. Therefore, I am going to opt for the previous approach.

Thanks for the help,
by Gerymake
Sun Jun 16, 2019 8:09 am
Forum: Python
Topic: Importing python code from a sub-folder
Replies: 6
Views: 328

Re: Importing python code from a sub-folder

I managed to do that. What I mean is that when I am running the read_sensors.py code I can't import the write_to_db.py which is in another directory. I am not sure whether it is clear or not. main.py \-- read_sensors \-- read_sensors.py (1st: I am running this code but I CAN'T from write_to_db impor...
by Gerymake
Sat Jun 15, 2019 3:43 pm
Forum: Python
Topic: Importing python code from a sub-folder
Replies: 6
Views: 328

Importing python code from a sub-folder

I have a main.py file in which I have imported all the files in another folder (read_sensors). In such folder, there is a script (read_sensors.py). When I have read a sensor, I ought to insert it into an MYSQL database. To do so, I guess it is better practice to create another folder in the original...
by Gerymake
Sat Jun 15, 2019 3:33 pm
Forum: Python
Topic: Reading LDR with MCP3008
Replies: 6
Views: 330

Re: Reading LDR with MCP3008

As it has already been mentioned, the problem was the frequency, it had to be limited. Anyway, I am a newbie at electronics and I do not fully understand what frequency are we limiting? I am familiar with this concept but I cannot relate to this case.

Thanks,
by Gerymake
Fri Jun 07, 2019 3:11 pm
Forum: Python
Topic: Reading LDR with MCP3008
Replies: 6
Views: 330

Reading LDR with MCP3008

Hello guys, I am trying to read a photoresistor via an ADC (MCP3008) in a Raspberry Pi Zero WH. I have followed this wiring diagram. http://www.pibits.net/wp-content/uploads/2016/09/pi-and-mcp3008-and-ldr_bb.png When it comes to the code, I came across two different snippets: 1.- With the gpizero li...
by Gerymake
Thu Jun 06, 2019 8:10 pm
Forum: Python
Topic: Exception or if statement
Replies: 3
Views: 252

Re: Exception or if statement

The generally accepted good advice in software engineering circles is: 1) Use exceptions for exceptional circumstances. Things that should never normally happen. 2) Do not use Exceptions for general program control flow. The DHT11 is notorious for being very difficult to read reliably, repeatedly. ...
by Gerymake
Wed Jun 05, 2019 9:25 pm
Forum: Python
Topic: Exception or if statement
Replies: 3
Views: 252

Exception or if statement

Hello everyone, I'm setting up an automated garden but I'm wondering whether this is the best approach to get readings from a DHT11 temperature sensor and check its content. Since the DHT-Adafruit library won't raise an error if it can't connect with the sensor I ought to check whether the reading i...
by Gerymake
Fri May 24, 2019 5:24 pm
Forum: Beginners
Topic: Connecting to several PI in the same network
Replies: 6
Views: 362

Connecting to several PI in the same network

Hello, I guess this must have been answered but I'm not sure how to find it. I have several Pi in the same network which ought to connect to a DB (installed in one of those Pi). I tried using the private IP address from (hostname -I) but it may change when disconnected or rebooted. Therefore, how ca...
by Gerymake
Mon May 20, 2019 9:23 pm
Forum: Camera board
Topic: Blue filter camera module
Replies: 5
Views: 387

Re: Blue filter camera module

Thanks for the info! I will definitely read through the article more thoroughly.
by Gerymake
Mon May 20, 2019 9:21 pm
Forum: Python
Topic: Storing multiple variables
Replies: 4
Views: 267

Re: Storing multiple variables

Makes sense, thanks for the help! :D
by Gerymake
Sat May 18, 2019 7:02 am
Forum: Python
Topic: Storing multiple variables
Replies: 4
Views: 267

Re: Storing multiple variables

Depends what you want to do when the sensor fails. If it takes an hour to recover then the temperature etc will be out. You could have three entries for each reading: Time Reading value Type of reading (eg sensor type) It makes collating a bit of a chore but you can always just store the time so ea...
by Gerymake
Fri May 17, 2019 9:52 pm
Forum: Python
Topic: Storing multiple variables
Replies: 4
Views: 267

Storing multiple variables

Hello, I can't seem to find a decent approach to my problem. I'm setting up an automade garden which is made up of several sensors collecting different types of data (soil moisture, light conditions, temperature...). I'd like to store all these variables in a MYSQL table under a same DATETIME, i.e.,...
by Gerymake
Fri May 17, 2019 4:31 pm
Forum: Camera board
Topic: Blue filter camera module
Replies: 5
Views: 387

Re: Blue filter camera module

I forgot to mention that. Yes, I intend to use it for plant analysis.
by Gerymake
Fri May 17, 2019 2:53 pm
Forum: Camera board
Topic: Blue filter camera module
Replies: 5
Views: 387

Blue filter camera module

Hello guys,

I have a throughly simple question, which I couldn't find an answer to. How should I place the blue filter which comes with the Pi camera over the lens? I ought to find a reliable approach sine I'll install it outdoors for a long periode of time.

Thanks,
by Gerymake
Tue May 14, 2019 2:33 pm
Forum: Automation, sensing and robotics
Topic: Soldering jumper wires to solenoid valve
Replies: 8
Views: 534

Re: Soldering jumper wires to solenoid valve

Put a decent electrolytic capacitor between the +12VDC power rail and ground, close to the FET (observe polarity) say 50VDC/1000uF. The solenoid will have a huge inrush current which could collapse the power rail enough to spike out the RPI. Testing with a globe is fine, but remember the solenoid i...
by Gerymake
Thu May 09, 2019 7:57 pm
Forum: Automation, sensing and robotics
Topic: Soldering jumper wires to solenoid valve
Replies: 8
Views: 534

Re: Soldering jumper wires to solenoid valve

Let me see if I understood properly. I should test the circuit with a 12V bulb. Afterwards, when I move the circuit to a perfboard, I could install the solenoid valve normally. Yes, exactly. you can test the valve directly with a suitable 12v dc supply, and use a low power 12v bulb in the breadboar...
by Gerymake
Thu May 09, 2019 12:41 pm
Forum: Automation, sensing and robotics
Topic: Soldering jumper wires to solenoid valve
Replies: 8
Views: 534

Re: Soldering jumper wires to solenoid valve

Having used a similar valve I think those wires would get hot if carrying a full load for longer than 10 seconds or so?.. My whoe valve starts getting Hot after 2-3 minutes running (via an opto isolator and relay) perhaps substitute a 12v bulb for breadboard testing if testing 'opening the valve' f...
by Gerymake
Wed May 08, 2019 8:35 pm
Forum: Automation, sensing and robotics
Topic: Soldering jumper wires to solenoid valve
Replies: 8
Views: 534

Re: Soldering jumper wires to solenoid valve

It would be on for very short periods of time. A few times a day maybe, it is just for a garden automation project. Anyway, what would be the better approach to this? This is the wiring diagram, I am using the breadboard for prototyping, when I have checked everything, I will move it onto a perfboard.
by Gerymake
Wed May 08, 2019 6:37 pm
Forum: Automation, sensing and robotics
Topic: Soldering jumper wires to solenoid valve
Replies: 8
Views: 534

Soldering jumper wires to solenoid valve

Hello, I have to solder two jumper wires to connect a solenoid valve (https://www.adafruit.com/product/996) to my breadboard. Unfortunately, all the wires I have are thiner than those of the valve. Therefore, I don't know wheter I may have heating problemas... As far as I know, it shouldn't suppose ...
by Gerymake
Wed May 08, 2019 6:30 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C sensor not being detected
Replies: 12
Views: 687

Re: I2C sensor not being detected

I received a refund, the sensor is faulty.
by Gerymake
Mon May 06, 2019 1:01 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C sensor not being detected
Replies: 12
Views: 687

Re: I2C sensor not being detected

DougieLawson wrote:
Mon May 06, 2019 12:42 pm
Have you checked whether it works on 3.3V or needs 5V to run the sensor electronics?
In the official site, it says it works with both 3.3V and 5V. Anyway, I checked it also with 5V, nothing shows up.
by Gerymake
Mon May 06, 2019 1:00 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C sensor not being detected
Replies: 12
Views: 687

Re: I2C sensor not being detected

You have enabled i2c in raspi-config? Tried other i2c devices? Has/is the sensor micro programmed? it can take awhile to sort out i2c. I have enable I2C in raspi-config and checked the file which looked OK. I tried an LCD screen, which worked well in both devices. I am not sure what you mean by mic...
by Gerymake
Sun May 05, 2019 8:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C sensor not being detected
Replies: 12
Views: 687

Re: I2C sensor not being detected

The JST socket cable is alright, it is showing values of .4-.5. Now, I know how may I have damaged it, if I shut down the Pi but I don't pull out the power supply, is it safe to mess around with the pins?

Go to advanced search