Raspberry Pi support - enables a hard-wired, dedicated dash
-
- Posts: 43
- Joined: Mon Nov 30, 2015 1:08 pm
- Location: Leicester, UK
Hi, thanks for the quick reply
So I tried the things you suggested and the screen now responds to keyboard / mouse inputs although the shortcuts that were added a page or two earlier in this thread don’t seem to work, only ESC and CTRL+C to quit. I can click into different screens / menus using the mouse but not the arrow keys, and the touchscreen still doesn’t operate within the app at all..
Outside of the RC app (ie in the desktop environment) it works perfectly - it’s almost as if the touchscreen inputs are not going to the app? Not sure if that’s even possible - could that be because I’m running it in the Raspbian desktop environment currently instead of the lite version only?
I mostly installed that OS so I could try and troubleshoot but also so I could get to the log file etc so the intent is to drop that once it’s working fully and I can go back to a stand alone type set-up (I only intend using this as the dashboard
Thanks again for the quick response and your help - appreciate the input
So I tried the things you suggested and the screen now responds to keyboard / mouse inputs although the shortcuts that were added a page or two earlier in this thread don’t seem to work, only ESC and CTRL+C to quit. I can click into different screens / menus using the mouse but not the arrow keys, and the touchscreen still doesn’t operate within the app at all..
Outside of the RC app (ie in the desktop environment) it works perfectly - it’s almost as if the touchscreen inputs are not going to the app? Not sure if that’s even possible - could that be because I’m running it in the Raspbian desktop environment currently instead of the lite version only?
I mostly installed that OS so I could try and troubleshoot but also so I could get to the log file etc so the intent is to drop that once it’s working fully and I can go back to a stand alone type set-up (I only intend using this as the dashboard
Thanks again for the quick response and your help - appreciate the input
Ok, so for future reference the logs are located in /home/pi/.kivy/logs. (I think, going by memory lol). you'll see a bunch of kivy_xx_x-x.txt because it logs a new one each time you open RCapp. personally, i'd like to see it overwrite, hint for brent.
I think your next fix is in the /.kivy/config.ini file. I think the line for the Input module needs tweeking. because of the :File "kivy/input/providers/hidinput.py", line 685, in _thread_run
IOError: [Errno 19] No such device error.
I think it should look like this:
[Input]
device_%(name)s = probesysfs,provider=hidinput
this is just a guess, I would think it would be fine with the default values. probably got screwed up because of a bad stretch install. it might be quicker to reflash, honestly. i'll write up a step by step when I get home tonite if you think it'll help.
I think your next fix is in the /.kivy/config.ini file. I think the line for the Input module needs tweeking. because of the :File "kivy/input/providers/hidinput.py", line 685, in _thread_run
IOError: [Errno 19] No such device error.
I think it should look like this:
[Input]
device_%(name)s = probesysfs,provider=hidinput
this is just a guess, I would think it would be fine with the default values. probably got screwed up because of a bad stretch install. it might be quicker to reflash, honestly. i'll write up a step by step when I get home tonite if you think it'll help.
here's a link to a step by step a did for another racer. it may help. also has some tricks for faster boot speed.
https://drive.google.com/open?id=1CwOL8 ... 8fBBMHqcpA
https://drive.google.com/open?id=1CwOL8 ... 8fBBMHqcpA
Last edited by PS14 on Tue Dec 18, 2018 11:07 pm, edited 1 time in total.
-
- Posts: 43
- Joined: Mon Nov 30, 2015 1:08 pm
- Location: Leicester, UK
I'm not sure how many here would find it useful but wanted to share that I put together auto dimming from a couple resources online. I'm also not sure if this will work with other displays but I'm using the official 7" touch unit:
You'll just need a small capacitor (105\1uf) and a photoresistor (GL5539\30-90kohm). Connect one leg of the capacitor to ground, one leg of the resistor to +3v, join the remaining legs together and jumper to GPIO (I used 17)
Then call the following script to the background. Based on available light it will update the screen brightness about once every 10 seconds. You can decrease the response time by decreasing the value after sleep.time near the bottom of the main loop.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
#ldr Reading Pin Definition
pin_to_ldr = 17
def rc_time (pin_to_ldr):
count = 0
#Output on the pin for
GPIO.setup(pin_to_ldr, GPIO.OUT)
GPIO.output(pin_to_ldr, GPIO.LOW)
time.sleep(0.01)
#Change the pin back to input
GPIO.setup(pin_to_ldr, GPIO.IN)
#Count until the pin goes high
while (GPIO.input(pin_to_ldr) == GPIO.LOW):
count += 1
return count
#Catch when script is interrupted, cleanup correctly
try:
# Main loop
while True:
bl = open('/sys/class/backlight/rpi_backlight/brightness','w')
okunan = 0
okunan = rc_time(pin_to_ldr)
if okunan <= 1500:
bl.write('200')
elif okunan <= 5000:
bl.write('160')
elif okunan <= 15000:
bl.write('130')
elif okunan <= 30000:
bl.write('100')
elif okunan <= 50000:
bl.write('75')
elif okunan <= 100000:
bl.write('50')
elif okunan <= 140000:
bl.write('30')
else:
bl.write('20')
bl.close()
time.sleep(10)
finally:
GPIO.cleanup()
You'll just need a small capacitor (105\1uf) and a photoresistor (GL5539\30-90kohm). Connect one leg of the capacitor to ground, one leg of the resistor to +3v, join the remaining legs together and jumper to GPIO (I used 17)
Then call the following script to the background. Based on available light it will update the screen brightness about once every 10 seconds. You can decrease the response time by decreasing the value after sleep.time near the bottom of the main loop.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
#ldr Reading Pin Definition
pin_to_ldr = 17
def rc_time (pin_to_ldr):
count = 0
#Output on the pin for
GPIO.setup(pin_to_ldr, GPIO.OUT)
GPIO.output(pin_to_ldr, GPIO.LOW)
time.sleep(0.01)
#Change the pin back to input
GPIO.setup(pin_to_ldr, GPIO.IN)
#Count until the pin goes high
while (GPIO.input(pin_to_ldr) == GPIO.LOW):
count += 1
return count
#Catch when script is interrupted, cleanup correctly
try:
# Main loop
while True:
bl = open('/sys/class/backlight/rpi_backlight/brightness','w')
okunan = 0
okunan = rc_time(pin_to_ldr)
if okunan <= 1500:
bl.write('200')
elif okunan <= 5000:
bl.write('160')
elif okunan <= 15000:
bl.write('130')
elif okunan <= 30000:
bl.write('100')
elif okunan <= 50000:
bl.write('75')
elif okunan <= 100000:
bl.write('50')
elif okunan <= 140000:
bl.write('30')
else:
bl.write('20')
bl.close()
time.sleep(10)
finally:
GPIO.cleanup()
-
- Posts: 43
- Joined: Mon Nov 30, 2015 1:08 pm
- Location: Leicester, UK
That’s awesome man, putting that on my list!!
PS14 - you’re a star! I started fresh, followed your instructions to the letter and it’s working!!
Next step get this installed in the car and give it a whirl with all the data sources connected up
Thank you for taking the time to get me up and running, I really appreciate it.
PS14 - you’re a star! I started fresh, followed your instructions to the letter and it’s working!!
Next step get this installed in the car and give it a whirl with all the data sources connected up
Thank you for taking the time to get me up and running, I really appreciate it.
RASPBERRY SCREEN BATTLE: WAVESHARE 10.1 vs SUNFOUNDER 10.1
I've decided the tablet is a complexity I want to ditch... so I'm going to replace that part with 17 other parts that make a raspberry Pi setup. Seem like the screen is the first big choice.
Please post your feedback or opinion on either of these screens:
https://www.amazon.com/gp/product/B0776 ... 2Q66&psc=1
https://www.amazon.com/gp/product/B01CU ... EBBE&psc=1
The support structure of the Waveshare seems better to me.. just not sure all other things are equal.
Thank you!
Please post your feedback or opinion on either of these screens:
https://www.amazon.com/gp/product/B0776 ... 2Q66&psc=1
https://www.amazon.com/gp/product/B01CU ... EBBE&psc=1
The support structure of the Waveshare seems better to me.. just not sure all other things are equal.
Thank you!
___________________________________________
School Of Racecar
Snowspeeder Pilots Association
School Of Racecar
Snowspeeder Pilots Association
of the two you listed I would choose the Waveshare. mostly because it has the lugs in the four corners which would make install easier. both appear to have lugs for mounting the Pi. I used an older Waveshare which does not, so my Pi just hangs of the header. mine is a Waveshare 1024x600 resistive touch. no complaints, install was easy. but the screen is hard to see from an angle in the sun. keep in mind these two are capacitive touch. just a couple observations,
Buildroot package for RCP App
I am working on adding a buildroot package for the RCP app, along with a default config for Rasberry Pi (and if I can manage it, BeagleBoneBlack) which will boot straight into the app. No more mucking around with apt.
This would enable pretty much turn-key build of an optimized sd-card image which would boot straight into the application.
It seems some of the groundwork has been laid, as I found a patch to enable building Kivy for the raspberry pi, which seems to work without modification. Cython cross-compilation is already a solved problem. I don't think it would be too much work.
You can follow my progress here: (note I'm taking some liberties at the moment, some of the hacks will need to be cleaned up before I can submit to upstream): https://github.com/emdash/buildroot/pull/1
This would enable pretty much turn-key build of an optimized sd-card image which would boot straight into the application.
It seems some of the groundwork has been laid, as I found a patch to enable building Kivy for the raspberry pi, which seems to work without modification. Cython cross-compilation is already a solved problem. I don't think it would be too much work.
You can follow my progress here: (note I'm taking some liberties at the moment, some of the hacks will need to be cleaned up before I can submit to upstream): https://github.com/emdash/buildroot/pull/1
Raspberry Pi4 support
First off I would like to say I have never messed with a Raspberry Pi before, and all of the information provided has been great to get me started.
I started off with a RPI4/waveshare 10.1 screen and could not get it to run the RCP program. So I stole the RPI3B from my sons Piper project and tried working with that. I was able to get everything to work fairly easily, but I struggled getting the touchscreen y axis inverted. After about 4 days of researching and trying different things I was able to fix it with a couple of things.
1. I had a mouse plugged into a USB port. When I looked at the .kivy log file it was recognizing the invert_y command, but after that it was recognizing the mouse. Once I unplugged the mouse and rebooted I was able to get it to work properly.
2. I had the [input] lines in the /home/pi/.kivy/config.ini in the wrong order. What I ended up with was:
[input]
mouse = mouse
device_%(name)s = probesysfs,provider=hidinput
ads7846 = hidinput,/dev/input/event3,invert_y=0,rotation=0
After I made these changes, the screen seems to be functioning normally. Hopefully this might help someone else from banging their heads against the desk for as long as I did!
Lastly, I probably should get the PI3 back to my son - so has anyone tried getting this set-up to work with a RPI4? I started off buying a 4 (not knowing any better) and I can not get the app to run at all. Here is the log file that I am getting after manually running the /opt/racecapture/run_racecapture.sh:
Any suggestions you have would be great as I am already working way above my head.
Thanks,
Matt
I started off with a RPI4/waveshare 10.1 screen and could not get it to run the RCP program. So I stole the RPI3B from my sons Piper project and tried working with that. I was able to get everything to work fairly easily, but I struggled getting the touchscreen y axis inverted. After about 4 days of researching and trying different things I was able to fix it with a couple of things.
1. I had a mouse plugged into a USB port. When I looked at the .kivy log file it was recognizing the invert_y command, but after that it was recognizing the mouse. Once I unplugged the mouse and rebooted I was able to get it to work properly.
2. I had the [input] lines in the /home/pi/.kivy/config.ini in the wrong order. What I ended up with was:
[input]
mouse = mouse
device_%(name)s = probesysfs,provider=hidinput
ads7846 = hidinput,/dev/input/event3,invert_y=0,rotation=0
After I made these changes, the screen seems to be functioning normally. Hopefully this might help someone else from banging their heads against the desk for as long as I did!
Lastly, I probably should get the PI3 back to my son - so has anyone tried getting this set-up to work with a RPI4? I started off buying a 4 (not knowing any better) and I can not get the app to run at all. Here is the log file that I am getting after manually running the /opt/racecapture/run_racecapture.sh:
Any suggestions you have would be great as I am already working way above my head.
Thanks,
Matt
- Attachments
-
- /opt/racecapture/run_racecapture.sh
- IMG_5030.jpg (76.5 KiB) Viewed 81781 times
RCP MK2
Raspberry Pi
Is there a way to get a virtual keyboard on the touchscreen? Also, is there a way to keep a text field active?
I can get the touchscreen to function for navigating around the program, but I can not type anything in. Currently I have to plug in my keyboard, hold the screen with a finger to keep the text box active and type with the other hand.
Any suggestions?
Also, is there any updates on the RPI4?
Thanks
Matt
I can get the touchscreen to function for navigating around the program, but I can not type anything in. Currently I have to plug in my keyboard, hold the screen with a finger to keep the text box active and type with the other hand.
Any suggestions?
Also, is there any updates on the RPI4?
Thanks
Matt
RCP MK2
Somehow, I just noticed, that Raspberry Pi 4 is not yet supported.
I was just about to order a Raspberry Pi 4, because, same price, more memory, more powerful than 3B+
@brentp I'm willing to be beta user It would be my first Raspberry Pi, but, I'm pretty good with computers and know enough with Ubuntu to be dangerous.
I was just about to order a Raspberry Pi 4, because, same price, more memory, more powerful than 3B+
@brentp I'm willing to be beta user It would be my first Raspberry Pi, but, I'm pretty good with computers and know enough with Ubuntu to be dangerous.