Go to advanced search

by tjrob
Fri Aug 23, 2019 1:48 am
Forum: Advanced users
Topic: Pimoroni pHAT DAC in C++?
Replies: 1
Views: 75

Pimoroni pHAT DAC in C++?

I have a project that must be written in C++, and I want to use the Pimoroni pHAT DAC. I have the hardware working, and some Python code correctly outputs to the DAC. (I am using this for a scientific instrument, not audio; this is one of the few audio DACs that can output dc levels, -3V to +3V.) Do...
by tjrob
Thu Jun 20, 2019 2:13 am
Forum: Camera board
Topic: CameraApp - A Simple Raspberry Pi Camera Application
Replies: 0
Views: 232

CameraApp - A Simple Raspberry Pi Camera Application

As this community has helped me so much, I thought I'd contribute my simple but fairly comprehensive camera app for full-resolution still pictures. It shows you how to do many useful things in Python with the RPi camera module. All of this is available elsewhere, but scattered around in very many pl...
by tjrob
Sun Jun 09, 2019 7:28 pm
Forum: Camera board
Topic: Pi Camera V2 failed to enable component: ENOSPC - failed imx219.c::imx219_op
Replies: 5
Views: 1327

Re: Pi Camera V2 failed to enable component: ENOSPC - failed imx219.c::imx219_op

I had the same ENOSPC problem when using picamera in python3 for single (still) images. I found two workarounds: 1. reduce the resolution -- it failed at 3280x2464, but succeeded at 1024x768 2. increase the amount of GPU memory. The default is 128 MB; 192MB permits 3280x2464. (do this in the Perform...
by tjrob
Sun Jun 09, 2019 7:28 pm
Forum: Camera board
Topic: Camera V2.1: failed to enable component: ENOSPC
Replies: 4
Views: 1676

Re: Camera V2.1: failed to enable component: ENOSPC

I had the same ENOSPC problem when using picamera in python3 for single (still) images. I found two workarounds: 1. reduce the resolution -- it failed at 3280x2464, but succeeded at 1024x768 2. increase the amount of GPU memory. The default is 128 MB; 192MB permits 3280x2464. (do this in the Perform...
by tjrob
Sun Jun 09, 2019 7:02 pm
Forum: Camera board
Topic: Camera not working - failed to enable component: ENOSPC
Replies: 9
Views: 2424

Workarounds: Camera not working - failed to enable component: ENOSPC

I had the same ENOSPC problem when using picamera in python3 for single (still) images. I found two workarounds: 1. reduce the resolution -- it failed at 3280x2464, but succeeded at 1024x768 2. increase the amount of GPU memory. The default is 128 MB; 192MB permits 3280x2464. (do this in the Perform...
by tjrob
Thu Jan 24, 2019 2:39 am
Forum: Advanced users
Topic: SOLVED: How do I get a login prompt on ttyAMA0???
Replies: 2
Views: 397

SOLVED: How do I get a login prompt on ttyAMA0???

The problem was that in rc.local I had code to set the time via ntpd. But the NTP server was unreachable, and this hung forever. Commenting that out fixed it.

I have no idea why running agetty manually (via ssh) did not work.
by tjrob
Thu Jan 24, 2019 1:00 am
Forum: Advanced users
Topic: SOLVED: How do I get a login prompt on ttyAMA0???
Replies: 2
Views: 397

Re: How do I get a login prompt on ttyAMA0???

I have verified minicom on my Mac laptop talking to the Adafruit USB<->Serial adapter at 115200 baud. With a jumper from green to white (Tx -> Rx) it correctly echos everything typed in the minicom window; removing the jumper stops the echo (as expected). I then connect the 4 wires to the RPi Zero W...
by tjrob
Wed Jan 23, 2019 4:39 am
Forum: Advanced users
Topic: SOLVED: How do I get a login prompt on ttyAMA0???
Replies: 2
Views: 397

SOLVED: How do I get a login prompt on ttyAMA0???

How do I get a login prompt on /dev/ttyAMA0??? Note there is A LOT of conflicting information about this on the web and in these forums; much is so old it uses /etc/inittab (not /etc/systemd) This is a Raspberry Pi Zero W running Raspbian stretch, but I also need to know how to do it on a RPi 3B+. u...
by tjrob
Thu Jan 03, 2019 4:20 am
Forum: Other projects
Topic: 150 MHz clock generator using RPi Zero W
Replies: 1
Views: 314

150 MHz clock generator using RPi Zero W

I just built a small clock generator box using a Raspberry Pi Zero W and the Adafruit Si5351 clock-generator board. Works great! It can generate a crystal-stable 3.3V square-wave clock at just about any frequency between 8 kHz and 150 MHz. Total cost was about $25 -- amazing! Note: above about 10 MH...
by tjrob
Mon Dec 24, 2018 3:30 pm
Forum: Advanced users
Topic: RPi won't boot with CPLD powered up
Replies: 2
Views: 1041

Re: RPi won't boot with CPLD powered up

Thanks. That's what I did: make the data bus be high-Z at initialization / power-up.
by tjrob
Sun Dec 23, 2018 4:34 pm
Forum: Advanced users
Topic: RPi won't boot with CPLD powered up
Replies: 2
Views: 1041

RPi won't boot with CPLD powered up

I built a 200 MHz frequency counter in a CPLD. It uses a 20-bit data-output bus plus three control signals, which I connected to GPIOs 2-24 on a RPi 3B+. Note that all bits of the data bus will vary high/low at 1 kHz, independent of the RPi. With the CPLD powered up, the RPi won' t boot. Once it is ...
by tjrob
Sun Dec 23, 2018 1:02 am
Forum: Advanced users
Topic: Solution: Dedicating one core to a real-time process
Replies: 9
Views: 2875

Re: Solution: Dedicating one core to a real-time process

That latency program doesn't actually do anything in the real-time process. In particular, it does not do the fprintf(socket, ...). Actually using it, I learned what should have been obvious -- network flow control can back up and block the fprintf(), causing it to miss samples. Fortunately there is...
by tjrob
Tue Dec 11, 2018 2:48 am
Forum: Advanced users
Topic: Solution: Dedicating one core to a real-time process
Replies: 9
Views: 2875

Re: Solution: Dedicating one core to a real-time process

The code attachment got lost. Here it is.

I also forgot to show how to build the latency program:

Code: Select all

g++ -o latency latency.cc Realtime.cc -lpigpio -lpthread
by tjrob
Tue Dec 11, 2018 2:45 am
Forum: Advanced users
Topic: Solution: Dedicating one core to a real-time process
Replies: 9
Views: 2875

Solution: Dedicating one core to a real-time process

Linux is most definitely not a real-time operating system, and if you just use the default configuration you'll find you occasionally have latencies as large as 50 milliseconds. That's pretty hopeless for anything that needs real-time response. You can certainly install some real-time OS, or write a...
by tjrob
Sun Oct 07, 2018 6:43 pm
Forum: Advanced users
Topic: Trouble with real-time code
Replies: 14
Views: 1477

Re: Trouble with real-time code

I assume that your program sets its scheduler to SCHED_FIFO and high priority. By default the kernel does not permit such real-time processes to starve other, non-realtime processes, so once per second it pauses the realtime process for 50 ms. As you observed. Here is my code to avoid this: #include...
by tjrob
Sun Oct 07, 2018 5:51 pm
Forum: Advanced users
Topic: Change max CPU freq without rebooting
Replies: 2
Views: 1401

Re: Change max CPU freq without rebooting

As already mentioned, the various govenors can be used to affect the CPU frequency changes. In Raspbian there is a more direct way, which can be done without reboot. The files in /sys/devices/system/cpu/cpu0/cpufreq directly control the kernel's turbo mode, which is what changes the CPU clock freque...
by tjrob
Sat Jan 07, 2017 4:04 pm
Forum: Advanced users
Topic: Comparison of cheap ultrasonic distance sensors
Replies: 0
Views: 878

Comparison of cheap ultrasonic distance sensors

I have an application that needs to measure distance to a wall that varies between 0.2 meters and 2 meters, at least 20 times per second. I purchased some SR-04 modules, but was disappointed in their performance. Recently I found the Sunfounder SF-SR02 which claimed to be more accurate than the SR04...
by tjrob
Tue Sep 06, 2016 11:27 pm
Forum: General discussion
Topic: Raspberry Pi WiFi question
Replies: 2
Views: 572

Re: Raspberry Pi WiFi question

Yes, this should work. An RPi should support dozens (if not hundreds) of separate connections over WiFi. While the RPi is not really a multi-user server, as a test I just connected 4 ssh sessions into one from two different machines.
by tjrob
Tue Sep 06, 2016 11:17 pm
Forum: General discussion
Topic: Run python script right after RPi boot
Replies: 7
Views: 7300

Re: Run python script right after RPi boot

The traditional way to do this is to call your script from /etc/rc.local. That is a script run near the end of the boot process after most system services have been started (but it does not guarantee that they all have actually started). Be sure to read this: https://www.raspberrypi.org/documentatio...
by tjrob
Tue Sep 06, 2016 10:59 pm
Forum: General discussion
Topic: Raspberry Pi with Internal WIFI dies during SSH session
Replies: 13
Views: 2008

Re: Raspberry Pi with Internal WIFI dies during SSH session

Worked for me on a brand-new Raspberry Pi 3B. It's running headless on my UVerse WiFi. I ssh into it from my Mac. I left a "top" running overnight (so it would have occasional traffic), then this morning I quit top and left an idle terminal session up all day. When I came home and typed <CR> it resp...
by tjrob
Tue Sep 06, 2016 5:07 am
Forum: General discussion
Topic: Pi 3 Overheating Issue?
Replies: 110
Views: 106845

Re: Pi 3 Overheating Issue?

I just got a brand new Raspberry Pi 3B. It definitely has overheating issues. When idle it is agreeably cool. But when I ran 4 infinite loops in the shell it almost immediately got too hot to touch, and I killed them as quickly as I could. Running just one infinite loop makes to too hot to touch. I'...
by tjrob
Tue Sep 06, 2016 4:49 am
Forum: General discussion
Topic: SSH from Mac to Pi
Replies: 5
Views: 1918

Re: SSH from Mac to Pi

Works for me on a brand new Raspberry Pi 3B. After doing "ifconfig" on the Pi's console and seeing it has IP 192.168.1.229, on the Mac I open a Terminal window and do "ssh [email protected].168.1.229"; it prompts me for the password and I'm in. My Mac runs El Capitan, but this worked from Mavericks in the past...
by tjrob
Tue Sep 06, 2016 4:18 am
Forum: General discussion
Topic: apt-get upgrade is breaking raspbian jessie
Replies: 7
Views: 1884

Re: apt-get upgrade is breaking raspbian jessie

Worked for me on a brand-new Raspberry Pi 3B. I bought the Starter Kit with an SD card; NOOB installed Raspbian, and "apt-get update" followed by "apt-get upgrade" worked like a charm. I started with a network cable, but it's much more convenient to use WiFi. I started with keyboard, mouse, and disp...
by tjrob
Tue Sep 06, 2016 4:10 am
Forum: General discussion
Topic: Micro Center "Progressive" PI Zero Pricing
Replies: 38
Views: 7130

Re: Micro Center "Progressive" PI Zero Pricing

This Micro Center announcement was timely for me, as I was about to purchase a Raspberry Pi 3B. I went there today (Micro Center in Westmont, IL) and was surprised to see >100 Starter Kits in a big bin, and >100 Media Kits in another bin, >30 bare Pi 3Bs in a third bin, and >100 Pi Zero in a fourth....
by tjrob
Sat Apr 05, 2014 3:00 pm
Forum: Other projects
Topic: Music Display - uses a pedal for turning pages
Replies: 9
Views: 4750

Re: Music Display - uses a pedal for turning pages

I am no longer using this music display, as I have found something much better. It has been well over a year since I have done any software on the Pi, and don't have answers for your specific questions. I am using a 13" Hannspree Android Tablet ($200), the MusicSheets app ($10), and a PageFlip bluet...

Go to advanced search