Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Professor of Cats
Mar 22, 2009

Kazy posted:

Just finished a Raspberry Pi-powered wireless backup camera project!





Cable management is not my strong suit :v:

More here:
https://imgur.com/a/0fqqQ

Nice work!!

Adbot
ADBOT LOVES YOU

Professor of Cats
Mar 22, 2009

Crosspost from "Post awesome AI car poo poo" - I wanted to share my fun little pet Pi project.

I absolutely LOVE anything auto-dashboard related especially when it comes to old school digital dashboards. I humbly submit my RaspberryPi creation for a friend's crazy EV conversion project. (search for Teslonda) It went into a 81 Honda Accord so I wanted a period correct aesthetic. My inspiration was a cross between 80's arcade game and early 80s digital dash (specially the 1983 mitsubishi cordia).

here is a screenshot of it in testing mode (dont mind the numbers here: they dont make sense)


Here it is in action:
https://www.youtube.com/watch?v=Uproz8DwcRE
https://www.youtube.com/watch?v=Fr7YF1gJPks

When the "motor" is cut; the dash goes into a "Continue screen" which counts down from 10, then it goes into a "demo" mode. The thing also serves up an app via wifi so you can do logging, etc on your phone. Raspberry Pi stuff is a goddamned blast!


setup details:
    Hardware
  • RPi 3 B
  • PiCAN 2 hat
  • LiFEPO4WERED/PI (safe shutdown and auto start up capabilities)
  • 7" touchscreen (800 x 480)
  • sparkfun GPS (20Hz) (logging assistance)
    Software side
  • Modified Chromium for the Dash front end (done in canvas)
  • NodeJS backend to handle CAN communication, logging, web server
  • Backend communicates with front end via websocket
  • Serves up app for phone via WiFi (personal AP)

Post your projects doods!

Professor of Cats
Mar 22, 2009

haveblue posted:

That looks awesome!

This is what I'm doing:



This is a toy Ghost I got from splurging on the collector's edition of Destiny a few years ago. It's a fairly fancy bit of tech that can light up and play dialog from the game when you wave your hand at it, but other than that it's just a toy.



However, once I open it up and remove some unneeded plastic, there's a cavity inside that should be able to fit a Pi Zero W, a tiny speaker, an even tinier microphone, and enough ancillary bits to drive the LEDs in the shell through GPIO. At that point I can install an Alexa client on it and have a video game toy that will finally talk back when I talk to it :unsmith:

This is as far as I've gotten right now, I need to resolve a software conflict between the tiny speaker driver and ALSA and investigate the LEDs to see if they can be changed from series to parallel for independent flashing.

Dude that is pretty drat neat.

Professor of Cats
Mar 22, 2009

e: /\ /\ yep!

Volguus posted:

How do you communicate with the car itself? What's the protocol? Do all cars have similar enough protocol or each is different?

It's through CAN (ev conversion car with it's own controller) using the PiCAN2 hat which has inputs for CAN-low and CAN-high.

Professor of Cats
Mar 22, 2009

Volguus posted:

Cool, thanks, never looked into this. This is the first time in my life that I asked myself these questions. From what I could google in the last 5 minutes it looks easy enough to get information. Are there things that can one use to simulate the car? For development?

I'm sure there are lots of options. here is one of the things I came across.
https://github.com/zombieCraig/ICSim

If you're interested in sniffing some CAN...an option is to use your Pi and a CANBUS shield (like the PiCAN2!) to just get a can dump of your current car using can-utils library . Then, using the same library (can-utils), you can use canplayer to just loop back that same candump, and develop against that.

Here is a gist that gets your raspberry pi ready for development if that is the case.

Also, check this link out to get some examples on how to use the can-utils and the various CANBUS shields.
https://isojed.nl/blog/tag/pican2/

e: accidentally a link

Professor of Cats
Mar 22, 2009

ickna posted:

This is absolutely cool as gently caress, and touches a lot of stuff I have been trying to work out for my own car-RPI integration project. Can you go into more detail on your power setup? I haven’t worked out the best approach for safely shutting down and starting the system without manual intervention. I’m also curious about how you draw the UI elements with everything booting properly and no user interaction to get everything up.

My project mostly involves a master RPi that resides in my trunk which takes care of providing GPS over the network via GPSd, and an APRS software modem (Direwolf) with some custom hardware to trigger the PTT on a Baofeng radio and USB sound card to do packet radio broadcast and reception. I use a second RPi as a viewscreen using Xastir for mapping the APRS data and GPS data over the network from the master unit. The idea is that I can pull the viewer unit out to hide it out of sight, but the master unit will continue to work without it and beacon the car’s position in the event that the car is stolen. This much is working so far, but requires a good bit of manual intervention between starting the whole kit up and shutting it down nicely before cutting ignition power.

I have planned further improvements such as ODB interfacing and accelerometer integration to provide a nice dash view of performance related and g-force data for autocrossing, and waking the master unit for an hourly beacon update via radio with location/voltage/temperature data while the car is parked.

Huge thanks and also your project sounds effin' awesome!!

Current setup:
  • keyed power -> 12v-5v DC DC converter with 2 usb outlets -> to my dash (cheap Chinese one from amazon, your results may vary)
  • LiFePO4wered/Pi3 to act as a UPS; https://lifepo4wered.com/lifepo4wered-pi3.html
  • Front end is a web app running in Chromium (with all the flags set to make it 'hardware accelerated')
  • The web app - most of the widgets in canvas. (more control on how, when and what is drawn)
  • A few configuration files to auto start chrome. Not included in the gist is using systemctl to setup a bootup service that auto starts my backend node app on boot.

So for the power;
Before, I just converted the system to readonly, which is a pain in the rear end to rev the software but at least it was safe to just hit the switch. Then, after looking through many power options, I settled for the LiFoPOW4ered over Juice4Halt. In short: it detects when it loses external voltage, and after X time, sends a safe shutdown signal to everything. When external power is restored, it boots it back up. Simple! And both of those offer quite a bit of longevity without external power.

Volguus posted:

Oh cool. Yeah, replaying valid pre-recorded data sounds reasonable enough (duh. why didn't I think of that). I see in your setup that you used LiFEPO4WERED/PI . That is because the PI cannot be powered from the OBD? So that battery charges when the car is off? How do you power that ?

I believe ODB2 has power supplied through it, so that is an option as well.

e: added more info on boot stuff
e2: The pi's battery charges when the car is on, because it is fed by 12v.

Professor of Cats fucked around with this message at 22:40 on Apr 12, 2018

Professor of Cats
Mar 22, 2009

CapnBry posted:

This is cool and you are awesome. It always pleases me to see a well executed solution like this. I have a plug-in Ford Fusion so for the past 4 years I've been saying I was going to do something like that and never could muster up effort to do it right. I love the attract / demo mode too where you get to see all the dials doing stuff, it really does have that come-and-put-a-quarter-in-me feel.

Have you thought of adding Wh/mi to that as well as sort of a fuel economy thing? I have to give Ford props for making a pretty decent dashboard display on my car but when you're on battery (almost all the time for me) it always reads 999mpg so when I am in that sort of mood I just run Torque on an old tablet to track it for me. Also the Ford system doesn't show you when you're regenerative braking more than the batteries can take which would make driving a little more fun if I could play the minigame of "Braking just right to not use brake pads".

EDIT: Forgot to ask, did you use a framework for doing the canvas widgets or is that all from scratch?

Awesome, thank you so much!!

To answer your question on "Watt/kW hours, battery power left"; that is in the works but the reason for the lack of it is I didn't have direct access to the battery management data at the time. (now I do). On top of that; our immediate needs were specifically output related instead of range related. (Drag strip reasons. :getin:) Now we want to daily this thing around so a range widget will find it's way in.

The regen stuff is fun; Tesla motors are AC motors, so with their giant inverters, they act like big ol' generators when no power is being applied...which actually feels like someone is stepping on the brake. The firmware reports how much kW it is actually being generating (super handy) so you can pedal play with how much "pseudo braking" you do before applying the actual brake. I'm not sure how regenerative braking is handled but I assume they would report it the same way? (in some form of kW?)

As far as the framework, it's all custom believe it or not! (I'm a glutton for punishment)
I wrote all the canvas widgets with a specific intent on only drawing when things are dirty and avoiding all unnecessary clears, etc. Which paid off because Xorg/Xserver is all CPU accelerated so minimizing all unnecessary screen draws payed off big time. The Pi does have a GPU but the current "3d drivers" are experimental and the "fake" 3d driver makes most of the acceleration through the CPU anyway. On top of that, I had to experiment with Chromium flags to see how I can get it to offload the "GPU" work properly. In short, all the canvas "best practices" paid off; no huge canvas objects, paint as much as you need too, dont downsample, etc etc.

The actual number readouts are standard HTML/CSS text readouts with a cool font.

Also, quick backstory on the Teslonda, it's a Tesla, Model S drivetrain (motor and inverter), HSR motor's firmware to interface with the Tesla motor, a Chevy Volt battery pack (very high discharge capability) with a 3rd party Australian battery management system that I cant remember off the top of my head. Lucky for me, the HSR Motor's firmware had a very well documented CAN setup that allowed me to design a dash around without too much reverse engineering.

K sorry for rambling and nerding out. :yaycloud: I think I rambled too much. I had some sake for dinner tonight.

EDIT:

I ran into a snag with the life4powered solution today; now that I added WiFi AP to it, it seems I'm pulling too much amps to keep a charge on the battery? (first guess anyway, more investigation required) :smith: I'll let you all know what I find out of course.

Professor of Cats fucked around with this message at 04:42 on Apr 14, 2018

Professor of Cats
Mar 22, 2009

Subjunctive posted:

If you’re braking then your foot is off the accelerator, so you’re getting maximum available regen as a baseline. Braking can reduce that if you overdo it. (The car will light the brake lights under heavy regen, but it’s not applying the brakes in that context.)

Sorry, I'm dumb. I have no idea what I thought you meant in my sake'd brain last night. Anyway, in the controller I have, you even have access to when that threshold is hit(literally a true/false). Those older models kind of dropped the ball on that readout.

Professor of Cats
Mar 22, 2009

Quick update!

On Friday, I think I killed the LifePOW4ered/Pi board. Mainly because I'm an idiot.
At first, the battery wasn't able to charge to what I believe was too much current I was drawing. (active wifi, 7" screen, lots of cpu based drawing, 2-4 active threads, CAN messages, etc). To test that theory, I busted out the multimeter and tools to confirm that was the case. In the process, I shorted a few things...cough..and now the pins responsible for jumping the pi back on do not work. (the battery board, not the pi thank goodness).

So you know what? Screw it! I have a perfectly good 12v battery already with switched power...why bother with the UPS solution?

Going over my requirements again...
  • A way to shut the pi down safely
  • cut power completely once it is shut down (prevent voltage drain)
  • power back on once power is resumed.

Instead of wasting time and wiring something up (ie bugging my buddy with the reflow oven) - I snagged one of these instead. Since the Teslonda's cockpit is already wired up like a 747 jet, I already have a toggle switch for this unit. I'm assuming I could do the same thing with a relay and switched power. Anyway, I'll give a trip report it is all wired up.

e: accidentally a word or two

Professor of Cats fucked around with this message at 19:25 on Apr 15, 2018

Professor of Cats
Mar 22, 2009

Hadlock posted:

99.9% of the things I've shorted and killed either happened after 11pm, involved alcohol, or both

:) Guilty.

e: (pew pew snipe etc)

Professor of Cats
Mar 22, 2009

CascadeBeta posted:

What's a good small screen (7 to 10 inches) for a Pi? I'm making an all in one fightstick out of MDF right now and I think I'm going to do a mini bartop next. I'd probably vertically orient the screen for use primarily with 80s arcade games.

I love the "official" 7" touchscreen (800x600 native res). I'm sure there are plenty of other options out there though.

In other news, The PowerBlock power switch works like a charm on the dash setup I'm doing. I have always-on/fused 12v going to a DC/DC 5V converter, then directly to the Powerblock on the pi. Then a key'd switch for the power jumper. When it is switched on, the LED I wired up tells me what it is doing and when I flip the switch off, it powers down without any issue. Pppperrrfect.




Please don't mind my lovely testing wiring job. :)

Professor of Cats
Mar 22, 2009

Varkk posted:

Just a quick question. What is the max resolution for a screen on the Pi’s internal display connector? I can’t seem to find anything in the specs. Just that it can drive a display connected to it. Some posts imply it only works with the official boards.

I believe it is 1080p. The "GPU" (multimedia processor) is VideoCore4 - Which are are on several ARM devices; I think they all support an output of 1920x1080 60Hz. (source: https://en.wikipedia.org/wiki/VideoCore)

Professor of Cats
Mar 22, 2009

I snagged a $9 wired one from Amazon. It's cheap and floppy but works perfectly.

Professor of Cats
Mar 22, 2009

forkbucket posted:

I made a thing!
--snip--


This is super rad! The frame is super nice too.
Also, use whatever you want. As long as you start and finish a fun project and it meets YOUR specs, that's A+ in my book.

Professor of Cats
Mar 22, 2009

Hey guys, just wanted to post more updates on my homemade dash for the Teslonda.

So we love the whole feel of the space ship vibe with all the switches and what not so we decided to go TWO displays; one being the primary dashboard and the other will be eye-candy / configuration / logging / GPS. Dash 1.0 had a 80s arcade style motif, so I wanted to keep a bit of that while adopting an overly complicated, "NES Space Sim meets knight rider" kind of look.

Complete with my dumb avatar's talking mouth telling the driver that his voltage sag reached critical levels or that the stator is about to melt from under the car.

Dash 2.0 demo
Quick test before we install it...
https://www.youtube.com/watch?v=ZpKafCbIVkM




(more here on the Jimmy.Built's instagram: https://www.instagram.com/p/BjxbvKeA3ZP/?taken-by=jimmy.built)

Parts role call:
Two raspberry pis, networked to each other. Optional (manual) wifi to communicate to the outside world.
Petroblock's Powerblock for both of them, operating off of a relay board, operated off of switch.
Two 10.1" touchscreen displays from Amazon (these things are pretty drat amazing so far).
A PiCAN2 CANBUS shield
lots of relays, wires, usb breakouts lol
and one big rear end Buck converter (12v-5v) with 4 separate 3amp usb outlets.

This is so much drat fun. GPS module coming soon. I just keep running out of free time to do this.

Professor of Cats
Mar 22, 2009

evil_bunnY posted:

Holy hell you work on that insanity? It’s so great.

Thanks! So far we haven't died.... yet. :)

Sad Panda posted:

Raspberry Pi v3b running DietPi 6.9. Things run on it just fine (I have Plex, PiHole, Sonarr qBittorrent, VNC, Radarr + Jacket on it) but it seems to want nothing to do with my laptop (192.168.1.10). I can connect to VNC and all the webbased things on my phone but if I run VNC Viewer on my laptop it won't work. I also am unable to SSH in with it.

It feels like my Pi has banned my laptop somehow. Where?

I've tried
sudo iptables -L -n

but the Chain INPUT, Chain FORWARD and Chain OUTPUT are all blank.

I've got fail2ban setup, but fail2ban-client status says I have 2 jails that are both empty.

Can you ping the pi from your PC on your local network? Vise versa?
E: accidentally a word

Professor of Cats fucked around with this message at 17:51 on Jun 11, 2018

Professor of Cats
Mar 22, 2009

Sad Panda posted:

I couldn't ping it no. Now that I changed my fixed IP from .10 to .154 I can access again so I'm assuming there's an IP ban on my Pi against .10 but no idea what triggered or, or where it is.

Maybe something else on the network had the same ip?
Disclaimer: Definitely not a networking expert

Professor of Cats
Mar 22, 2009

Loky11 posted:

gently caress this is cool

Thanks! :respek: I am like a kid again and I can actually make my video game dash haha. If I had more time, it would be extremely over the top, busy robot interface style.

Professor of Cats
Mar 22, 2009

wolrah posted:

There are a few HATs that can accept various kinds of rechargeable batteries and provide either a "low battery" GPIO signal or actual charge state information for monitoring and safe shutdown.

https://lifepo4wered.com/lifepo4wered-pi+.html
If you're going for portable, one of the ones that can monitor voltage and recharge the battery is probably a good way to go.

I'm a big fan of the lifepo4pered one. fairly easy to setup and configure. Great for a temporary UPS. Super easy to tell the Pi to shutdown gracefully when power has been cut after X amount of time or when Y percent of battery life is left.

e: accidentally a word

Professor of Cats fucked around with this message at 23:46 on Oct 25, 2018

Professor of Cats
Mar 22, 2009

evil_bunnY posted:

Industrial poo poo worth anything is driven by PLCs

Stuxnet would also agree :getin:

Professor of Cats
Mar 22, 2009

Super Slash posted:

Absolutely this, every time I've tried to use a Pi for emulators it's never been able to go above the Mega Drive (even SNES games like Starfox/F-Zero will run like garbage).

However feast your eyes on these beauties which came out recently;

RetroFlag MEGAPi Case


RetroFlag SUPERPi Case


aaaaaaaaaaaaaand purchased

Professor of Cats
Mar 22, 2009

Just a quick trip report;
I did snag one of those RetroFlag cases (looks fantastic), a raspberry pi 3 B+, heatsink and fan. I loaded it up with the latest RetroPie OS and tried out the SENS emulator on my 1080p tv: A+. Runs and looks like a dream.

Professor of Cats
Mar 22, 2009

bolind posted:

It’s used to test and benchmark code aimed to run on that platform. Does it compile? Do the tests run? How fast is our standard test? Is valgrind happy?

We have certain optimized functions that sport ARM intrinsics, using the vectorized operations and such, which can really only be exercised on real hardware.

I dig it. Nice work!

Adbot
ADBOT LOVES YOU

Professor of Cats
Mar 22, 2009

Cojawfee posted:

I'm not really even sure why you would want to have two monitors with a Pi.

The only scenario I came across was wanting two displays for the teslonda dash; Instead I networked together two separate Pis like a goddamn psychopath

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply