Go to advanced search

by MadCow42
Fri Jul 26, 2019 1:40 pm
Forum: Python
Topic: Transfer Image from Raspberry Pi (Python) to Android app (Java)
Replies: 2
Views: 246

Re: Transfer Image from Raspberry Pi (Python) to Android app (Java)

On the sending side, close the connection once all data is sent. conn.shutdown(socket.SHUT_RDWR) I had similar issues that were resolved this way. The last "packet" is smaller than your max read size, so it's probably sitting there waiting to fill your buffer size instead of realizing the data strea...
by MadCow42
Fri Jul 26, 2019 1:34 pm
Forum: Python
Topic: Issue with i2c detection "disappearing" after contact
Replies: 1
Views: 102

Re: Issue with i2c detection "disappearing" after contact

I've had shaky i2c performance as well, until adding fairly low-ohm pull-up resistors to the circuit. Think 1-2k. It'll help in any case, if it's hardware related.
by MadCow42
Wed Jul 03, 2019 8:28 pm
Forum: Automation, sensing and robotics
Topic: Moving water from tank to tank controllled by rpi
Replies: 5
Views: 434

Re: Moving water from tank to tank controllled by rpi

to make intelligent decisions on when to activate the pump and how long to run it for, you really need a level sensor in each tank. Easy version: a float switch to tell you when each tank is "full"... but if it's not 100% full, you have no idea how much is in there. Better version: an actual level s...
by MadCow42
Wed Jul 03, 2019 7:55 pm
Forum: Python
Topic: problem with python code and button switch
Replies: 2
Views: 281

Re: problem with python code and button switch

Just as a matter of code design, this really should be done with a callback watching the GPIO for changes in state, not checking the state in a loop. Using a loop, if the button is pressed and released during the "sleep" time, then you'll never know it was pressed. if you use the pigpio library, it ...
by MadCow42
Wed Jul 03, 2019 7:34 pm
Forum: Python
Topic: Python Code for AS89010 current-to-digital converter in I2C with Raspberry Pi
Replies: 2
Views: 448

Re: Python Code for AS89010 current-to-digital converter in I2C with Raspberry Pi

The first things I'd check would be hardware related... 1) measure the output of the photodetector circuit where you have it connected to the ADC. Make sure it varies appropriately as the light level changes. 2) test the ADC with a known voltage supply, like a battery, etc. to ensure you get a reaso...
by MadCow42
Sat Apr 06, 2019 10:08 pm
Forum: Python
Topic: Simultaneous control of two stepper motors through a gui (pyqt 5)
Replies: 3
Views: 664

Re: Simultaneous control of two stepper motors through a gui (pyqt 5)

I'll second the threading option.... one thread for the GUI (main thread), and one for each stepper motor. Use events/flags to communicate to the worker threads.
by MadCow42
Sat Apr 06, 2019 10:05 pm
Forum: Python
Topic: Running and Referencing Two Python Programs Simulataneously
Replies: 2
Views: 439

Re: Running and Referencing Two Python Programs Simulataneously

Check out SQLite... it's a SIMPLE file-based database system that manages all the locking stuff for you. You can simply write values to a table in one program, and read them in another program without fear of stepping on each others toes. There's a Python module specifically for it. If you know anyt...
by MadCow42
Sat Apr 21, 2018 3:57 pm
Forum: General discussion
Topic: RPi3 with no GPIO pins, or reverse-mounted pins?
Replies: 14
Views: 3439

Re: RPi3 with no GPIO pins, or reverse-mounted pins?

Lol, yes no worries! It didn't look so dark here, but then again I know what I'm looking at. :) It's worked out quite well being reverse mounted like that. I put heat sinks on the Pi to be sure, but temps hover around 49C most of the time. All my relay driver and other circuitry sits under the Pi, a...
by MadCow42
Sat Apr 21, 2018 1:40 pm
Forum: General discussion
Topic: RPi3 with no GPIO pins, or reverse-mounted pins?
Replies: 14
Views: 3439

Re: RPi3 with no GPIO pins, or reverse-mounted pins?

Thanks for the help last year guys... just came across my old post and wanted to show you what I finally did in my PCB design after your input. It's working out great! The Pi is mounted upside down on an extra-tall female header, and is supplied power through a filtered power supply on the main PCB ...
by MadCow42
Sat Apr 21, 2018 1:30 pm
Forum: Troubleshooting
Topic: SaintSmart 2 channel SSR Closes But Never Opens?
Replies: 6
Views: 483

Re: SaintSmart 2 channel SSR Closes But Never Opens?

Just a "stupid" question... we're all assuming this is a DC SSR board... if it's designed for AC and is a "zero crossing" SSR, it'll never turn off when driving DC loads. Based on the symptoms you list, I'm willing to bet that's the case: it's not a lemon, but wasn't designed to drive DC power.
by MadCow42
Mon Apr 16, 2018 10:11 pm
Forum: Troubleshooting
Topic: USB bus issue / Pi freezing or WiFi dropout
Replies: 4
Views: 384

Re: USB bus issue / Pi freezing or WiFi dropout

Bump... Any feedback from the USB team? Any suggestions on troubleshooting? Thanks!
by MadCow42
Thu Apr 12, 2018 3:02 pm
Forum: Troubleshooting
Topic: SaintSmart 2 channel SSR Closes But Never Opens?
Replies: 6
Views: 483

Re: SaintSmart 2 channel SSR Closes But Never Opens?

I'll second that... the SainSmart boards need 5V logic, and being active low, they'll stay energized (mostly) even when you apply a 3.3V signal - especially if you have any ground differential between the Pi power and any separate power for the SainSmart board (some of their boards have a separate p...
by MadCow42
Thu Apr 12, 2018 1:29 pm
Forum: Troubleshooting
Topic: Not measuring Elapsed Time between GPIO state change
Replies: 2
Views: 247

Re: Not measuring Elapsed Time between GPIO state change

Using the code tags will help, but you probably are having an issue with local/global variables. You're modifying a variable within a function, but that information is kept ONLY within that function. You'll need to return the elapsed time from within that function so that the outside world knows of ...
by MadCow42
Wed Apr 11, 2018 8:10 pm
Forum: Troubleshooting
Topic: Problem recording video using Pi Camera v2
Replies: 2
Views: 443

Re: Problem recording video using Pi Camera v2

Well... does /home/pi/Desktop/video.h264 exist? Is it a video device?

Normally I'd expect a camera to show up under /dev/ instead of on your desktop... you're probably just pointing to a nonexistent camera.
by MadCow42
Wed Apr 11, 2018 5:04 pm
Forum: Troubleshooting
Topic: USB bus issue / Pi freezing or WiFi dropout
Replies: 4
Views: 384

Re: USB bus issue / Pi freezing or WiFi dropout

Awesome thank you... any help is appreciated!
by MadCow42
Wed Apr 11, 2018 3:01 pm
Forum: Troubleshooting
Topic: USB bus issue / Pi freezing or WiFi dropout
Replies: 4
Views: 384

Re: USB bus issue / Pi freezing or WiFi dropout

On a side note... we also use pigpio to use various GPIO pins to talk to serial devices. On my testing rig I disabled any of those operations to ensure they didn't conflict with the USB webcam somehow, but the pigpio driver was still running in the background. My initial research shows that the wifi...
by MadCow42
Wed Apr 11, 2018 2:10 pm
Forum: Troubleshooting
Topic: USB bus issue / Pi freezing or WiFi dropout
Replies: 4
Views: 384

USB bus issue / Pi freezing or WiFi dropout

I use the Raspberry Pi 3 as the core of a PLC we manufacture for automation systems. I have about 100 of these systems in the field currently, but I'm still battling a recurring issue with using USB webcams. These issues are consistent across all devices we use cameras on, so it's not an issue with ...
by MadCow42
Wed Apr 19, 2017 4:15 pm
Forum: General discussion
Topic: RPi3 with no GPIO pins, or reverse-mounted pins?
Replies: 14
Views: 3439

Re: RPi3 with no GPIO pins, or reverse-mounted pins?

Thanks for the ideas guys - some of those might work. Upside-down is probably closest, but I'll need an extra-tall header of some sort to bridge the gap. I'm sure someone makes those though.
by MadCow42
Sat Apr 15, 2017 7:58 pm
Forum: General discussion
Topic: RPi3 with no GPIO pins, or reverse-mounted pins?
Replies: 14
Views: 3439

Re: RPi3 with no GPIO pins, or reverse-mounted pins?

Not the ideal news I was hoping for, but I do appreciate the clarity! :) Thank you.
by MadCow42
Thu Apr 13, 2017 6:26 pm
Forum: General discussion
Topic: RPi3 with no GPIO pins, or reverse-mounted pins?
Replies: 14
Views: 3439

RPi3 with no GPIO pins, or reverse-mounted pins?

I'm looking to mount a Pi directly on TOP of another larger board, and was wondering if it's possible to purchase the Pi 3 without header pins, or with the pins mounted on the bottom rather than the top (similar to the Pi Zero... but I need the USB inputs and higher power of the Pi 3)? Would that be...
by MadCow42
Tue Sep 16, 2014 3:23 pm
Forum: Python
Topic: Send Message From C# Program To Python Process
Replies: 7
Views: 5458

Re: Send Message From C# Program To Python Process

Python already has built-in socket libraries... they're dead simple to use. You're using sockets in your C# program already... just use that for inter-process communication. It'd take all of about 5 lines of code, seriously.

Lots of examples on the Python website.
by MadCow42
Fri Jul 25, 2014 6:40 pm
Forum: Python
Topic: how to get a serial event to update a tkinter screen
Replies: 6
Views: 4844

Re: how to get a serial event to update a tkinter screen

if I insert this into my app class I get syntax errors (self has no function after I think) Your class should inherit from one of the Tkinter classes which do have the .after method. I created a traffic light example for someone several months back which shows how to use .after. Have a look at http...
by MadCow42
Thu Jul 24, 2014 6:24 pm
Forum: Python
Topic: Text file with variables
Replies: 8
Views: 1876

Re: Text file with variables

I'd suggest that you use something more identifiable than "name" though... just so you don't run into any issues if you actually want to use that word in the text.

Typical placeholders might be something like "%name%" or "<name>" or similar.

Just my $0.02.
by MadCow42
Thu Jul 24, 2014 6:01 pm
Forum: Python
Topic: how to get a serial event to update a tkinter screen
Replies: 6
Views: 4844

Re: how to get a serial event to update a tkinter screen

The threading solution posted above is the "right" way to do it, and will work fine. The challenge in doing this with a simple loop in Python is that once you call the Tkinter.mainloop() function, it basically is an endless loop on its own until you exit the widget. So - no code after your mainloop ...
by MadCow42
Thu Jul 03, 2014 5:46 pm
Forum: Automation, sensing and robotics
Topic: How to control RC car/GPIO?
Replies: 6
Views: 3244

Re: RC car GPIO interface

You can set up a web server on the RPi, but I prefer to use sockets instead. i.e., write a program that listens to an open socket for commands and run it on the RPi. Then write a client program on your tablet/phone that connects to that socket to send commands (via text strings/etc.). The Python Soc...

Go to advanced search