|
Post by jhornbr225 on Mar 17, 2020 13:54:45 GMT -5
In this age of Social Distancing, I keep coming up with new projects.
I ordered some parts last night:
A DS18B20 Temperature Sensor $0.89 A DS3231 RTC Module $0.71 A UGREEN USB Sound Card $6.29 A Cambridge USB Bluetooth 4.0 module $1.29
So, all in all, other than parts I have sitting around, so far I'm in about $9.18. Those parts are all coming from China, we'll see how long they take. I could have got them from Amazon for more, and not waited as long, but I'm not in a hurry.
I got a Pi 4 2GB for Christmas, they were $45 at release, but due to a recent price drop, they are $35. I already have a TDA7850 4-Channel Amp, about $20. I already have a 7" Official Touchscreen. I think it was about $65 a few years ago when I bought it. I can interface a NEO-M8N GPS module, that was like $13 with an antenna. I had bought 2 for the Accord PC, but only used one due to the fact that Streets and Trips was very picky on the GPS module it wanted to work with. I already have a Pi Camera for the backup cam, although I'll need to get an HDMI Cable Extender Kit, about $15. I already have the Double DIN case to put it all in. I forget how much that was, how many years ago I bought it. I'm sure I'll be using some Opto-Isolators that I have left from the Accord PC project to interface with the GPIO.
I'll need to build some sort of Ignition Aware 5V Supply. On the forum, it appears a dual relay setup is popular, I'll have to research that more.
The software comes from Blue Wave Studios. They get $28 for a license with lifetime updates.
Reading their forum, since it's really running Raspbian at the heart of it, a guy with a Jaguar even used a CANBus module on the Pi, and interfaced with his Climate Control.
End Goal is to put this in the Tacoma. I'll have to take out the composite Rear Cam and swap it with the Pi Cam. Although I do plan to install that camera while I wait for parts/build this thing.
And unlike the Accord, I'm not going to take the truck all apart for an extended time. I plan on running this on the bench this until I'm happy. Then at that point it will basically be a Double DIN install, with running an HDMI cable for a rear Cam, and modifying the rear cam.
|
|
|
Post by jhornbr225 on Mar 20, 2020 15:27:10 GMT -5
I did some reading on the forum about the safe startup/shutdown of the Pi. One of the methods that looks promising is they use a timer relay module. So I looked on Ebay, I found them for as little as $0.90 free shipping, so I ordered 4. In the diagram I found they use one of those automotive 30A 12V relays's Normally Closed contact to... wait for it.... act as a pulldown on a GPIO input. How many mA is is that? Probably less than 20mA. (It's actually about 55uA.) So I'm sure that I can use another 12V relay that I have laying around. So, it looks like a timer relay module, a couple diodes, and another relay, along with the required 12V to 5V converter. And a script running on the Pi. Hell, looking at it again, instead of that extra relay, why not just use an opto tied to the Ignition voltage, that would accomplish the same as a NC contact on a relay, and no need for an extra relay coil or snubber diode across that relay coil. I take that back, it would take 2 optos to mimic the NC contact, or maybe just use a 2N2222 transistor to invert the signal. Or I think one of the posts on the thread talked about changing the script to instead of looking for being pulled to ground, look for being pulled to 3.3V, PULL_UP instead of PULL_DOWN. Should be simple.
|
|
|
Post by jhornbr225 on Mar 25, 2020 12:36:22 GMT -5
Well, in an effort to make this build as fast as possible, I figured that I would look for a upgrade to my Micro SD card. I can't seem to find any specs on the max bus speed that the SD card is attached to, but from several reviews, it appears that some of the quality Sandisk or Samsung higher end cards with an A1 rating do best. So I checked Amazon, trying to order one of these cards. Surprise! Thanks to the "Cough Cough" (A phrase I picked up from YouTuber ETA Prime), many non-household items on Amazon now have extended shipping times, allowing them to prioritize household items. Although they still don't have any Purell Hand Sanitizer in stock. Some of these SD card would not arrive until the end of April, almost a month! After a little seaching, I found one that I can get on Saturday. I found a review of cards tested in the Pi4 www.pidramble.com/wiki/benchmarks/microsd-cards. I picked a www.amazon.com/gp/product/B06XWMQ81P/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=mmjjg-20&linkId=663ed59992727169bc8817425e409b27&language=en_US&th=1It's the 32GB version of the 64GB in the review. I hope it's the same. I'll have to test it. According to the pictures, it's got the same A1 and V30 ratings. Considering all I can find around here that I already have is a class 10 card, I hope this is better. So I can add $10.30 to my total. In the meantime I thought about removing the Pi 2 that is currently attached to my Official Touchscreen, mount my Pi 4, and boot it up with a Class 10 card I have.
|
|
|
Post by COMpulse on Mar 26, 2020 8:38:24 GMT -5
For most of my recent Pi builds (RetroPie and Kodi), I now use a USB-attached drive for the OS.
The Pi 3 can boot from USB directly with no SD card. The Pi 4 still requires an SD card for booting the Pi, but the OS can be on a USB drive. So the SD card gets less wear, and is less likely to be corrupted. And the SD card performance doesn't really affect the system. The only real problem is the physical drive being attached to the pi, increasing the footprint.
I wouldn't use a USB thumb drive, but USB HDD and USB SSD have both worked good for me.
|
|
|
Post by jhornbr225 on Mar 26, 2020 9:35:39 GMT -5
Yeah, I keep reading about a coming firmware update to allow the Pi4 to work from an external drive. But yeah, I agree about putting the OS on a USB3.0 attached SSD. Still, as faster SD card can't hurt to have.
I had been hoping to buy another one of those Kingston A400 SSD drives, as I had bought several for about $26, but the price is currently $39 so I was holding off. Actually I had one in an USB3.0 to SATA converter, but I took it out last week and installed in in the CarPC chassis I have that still had a Western Digital spinny drive in it. I had planned on using that for media, but maybe I jumped the gun, as I really don't have a use for this CarPC chassis. I was just perturbed that it was so slow after updating it to WIN10. So I put the 120GB older SSD that I took out of the CarPC chassis that I took out to the garage in there. I suppose I could use that for the OS, at least until I get another SSD.
I have purchased, in the past, a couple of Samsung 850 EVO 250GB SSD's, I wonder where those ended up....
If I could find one of those being used in a non-critical application, I could steal it.
EDIT: After a little searching on here, I found out where one of them is. In the CarPC chassis that I removed from my garage after getting the better chassis going. I had some problems out there in April 2018, the spinny drive was failing, so I put a Samsung SSD out there. That's definitely not a critical application as that PC is now sitting idle. Now where did I put the other one?
EDIT 2: I'll have to look, but I think my other Samsung drive is my media drive that's installed inside the case of the Beelink X55 PC that's in my Accord. If so, that's a good place for it and I'll leave it there.
|
|
|
Post by jhornbr225 on Mar 28, 2020 19:26:46 GMT -5
Wow, stuff somehow is coming faster than expected from China.
The RTC showed up 3/27, and the USB Soundcard showed up on 3/28. I checked the listings, they said they were shipping from China. I ordered them on the 16th.
The Micro SD card that was supposed to show up Saturday, showed up Friday instead, but that was Amazon.
I had also ordered a new keyboard/mouse for my old computer, it was supposed to show up Sunday, but it showed up Saturday, a day early, also Amazon.
I watched a couple videos on the Micro SD/SSD thing last night. I'm going to give it a try in the Pi 4.
Somehow time is really flying by being stuck in the house.
I was out in the garage most of the day yesterday, working on the mower. I was going to carry in the CarPC chassis that has the Samsung drive in it when I came in, but it was raining, so I decided not to. I can still build the Pi 4, screen, and new SD card and test it's speed.
|
|
|
Post by jhornbr225 on Mar 28, 2020 21:58:22 GMT -5
I removed the Pi 2 that was attached to my touchscreen. I downloaded and installed the new SD Card Imager from the RPi Foundation. I used it to write the latest image to the new SD card, and then put it in the Pi4. I attached it to the touchscreen, inserted the display ribbon cable, and put a couple jumpers in for the 5V and GND from the touchscreen to the Pi pins 4 and 6 respectively.
I went through the automatic setup screens, but had it tied to an ethernet cable, so no Wifi needed. I then ran the script from the SD card benchmarking page, and I got results within a range of what that card was tested at, even though they tested the 64GB, and I got a 32GB.
hdparm buffered MB/s Mine Theirs 43.71 43.73
dd write MB/s Mine Theirs 36.8 36.3
4K Random Read MB/s Mine Theirs 7.06 7.35
4K Random Write MB/s
Mine Theirs 3.38 3.70
The list shows cards that get up into the 10 MB/s range in the 4K Random reads, but those card's Random Writes are slower.
This card should be fine, considering I hope to go to the SSD anyway. All this effort for it to read one little file on boot, and then be pointed at the SSD.
|
|
|
Post by jhornbr225 on Mar 30, 2020 9:27:17 GMT -5
Open Auto Pro has the capability of hiding the Raspbian Desktop stuff showing during booting with some splash screens. It appears to be split into two parts, part0 and part1. The part0 plays once, then the part1 loops until the booting is done. I found some still images for Honda over at the XDA-developers website and downloaded them.
Step 1. I use Minitool Movie Maker to string them together, showing each image for 0.2-0.3 seconds to make the first video be about 10 seconds. Minitool Maker is not that precise in the time for each .jpg though, but it worked. I repeated that for both parts. The images were 1920x1080, so that's what the .mp4 file turned out as.
Step 2. I used Handbrake to make them into 800x480 .mp4's to match the official touchscreen.
Step 3. I used an online converter to make them into the Raw .h264 files the Pi requires.
Not bad. By playing the two parts together in VLC it looks like a pretty fluid movie.
Then, as I sit here typing this, I realize I didn't need a Honda one, this is going into the Toyota Tacoma. There was already one made for Toyota. I suppose I could still see if there were any others that emphasized the "Truck" more.
|
|
|
Post by jhornbr225 on Apr 7, 2020 20:50:31 GMT -5
Well, the UGREEN USB soundcard arrived last week, and the USB Bluetooth module arrived today.
I think with that arriving, I could actually pay for the license for Open Auto Pro, and get that started.
I've already got the Pi mounted to the screen, and I've tested the soundcard with headphones, seems to work OK.
I've also made the two Toyota videos for the splash screen.
So at this point, all I'm waiting for is the timer relay module and the temperature sensor. Neither of those are absolutely required to get Open Auto running.
I've brought in the old Garage PC with the Samsung SSD drive in it. I need to image that PC to the older SSD I took out of what is now the current Garage PC, and then I can steal the Samsung SSD.
|
|
|
Post by jhornbr225 on Apr 10, 2020 13:24:31 GMT -5
Well, I sprung the $29.74 for the license today. $28 plus some tax or something, I guess. Got an email that went to spam with links and a license code. Downloading 2.5GB now.
|
|
|
Post by jhornbr225 on Apr 10, 2020 21:10:08 GMT -5
Burned the SD card. It was recommended to use Win32DiskImager, some people had trouble with Etcher.
Overall it was pretty easy. I copied my splash screen videos over, but learned you have to do it in terminal, as that's the only way to set the permissions to write to the file locations. I found that my video was a little too long, and it was actually slowing the boot down, so I remade the video, and bumped up the frame rate so it would finish in 7 seconds instead of 10. Now I actually see the static "Toyota" for a second or two after the video before I get music. I did have to use ffmpeg on the Pi itself to do something to the videos, as when they came from my PC, although they played in VLC, they didn't show while booting.
ffmpeg -i {source file}.m4v -pix_fmt yuv420p -an -vcodec libx264 -crf 23 { destination file}.h264
Found that in the Blue Wave Studio forum.
I did have a little trouble with Bluetooth. I'd pair my phone on the Desktop of the Pi, as per instructions, but the Pi would say something about no services on my device. So after that I started OpenAuto on my phone, and set it to Autolaunch when the Pi connected to it, and it started working.
I even got the Pi working with my phone wirelessly. You turn on the hotspot on the Pi, and connect to that Wifi on your phone. So, cool, no wires to use OpenAuto on the Pi.
I put some local media on the Pi, and it plays it no problem.
I plugged a mic into the USB soundcard, and was able to talk to the Pi and tell it to play albums, or artists that were on my phone.
Next is to get the Samsung SSD out of that previous Garage PC, and put the old Intel SSD in there. Then I can do the SSD thing to the Pi. So far, it's booting to music in about 26 seconds.
Waiting for some parts to get the power supply hooked to it, and have it be ignition aware. Originally I was powering it through a Micro USB cable to the screen's board, but I was getting lightning bolts, warning me about low voltage, so I switched over to a USB-C cable, straight into the Pi, and then the screen got power from the GPIO, and that fixed the voltage problem. I don't plan on using a USB-C cable in the final configuration. I'm thinking I'll be designing a board to have made in China, with optos for the inputs to the GPIO's, and screw terminals for all the wires I need to go to the outside world. And I'll have to design it as such to leave the top of the Pi open for either heatsinks or a fan. So the board can go probably go off to the side somehow. I'll have to think on that.
I'm a little bummed, in local media, there is a volume control on the screen, but if you go into OpenAuto, to adjust volume you have to click on a dropdown from the top of the screen. There are keyboard controls for volume, so if I don't control it with an analog pot on the output side, I can use an Arduino and make keyboard commands, and maybe make some steering wheel buttons for the truck, as it does not have them now. But I am getting ahead of myself.
|
|
|
Post by jhornbr225 on Apr 12, 2020 18:29:24 GMT -5
Yesterday, I went to migrate the OS from the older Garage PC to a different SSD so that I could steal the Samsung out of it for the Pi. I was bummed to find out that the utility I had used before, MiniTool Partition Wizard 11, had been updated to Version 12. And they so kindly removed the Migrate OS from the free version. So after some searching, and downloading and installing a few utilities, and finding that even though they claimed to Migrate the OS, it always seemed to not exist in the free version. Finally I found AOMEI Partition Assistant Standard, that worked. Last night I pulled the Samsung out and installed the Intel drive.
Today I went through the procedure I found from Youtuber Andreas Spiess on getting the Pi to boot from SSD. He was following a procedure from jamesachambers.com. On the site there is a link to a drive speed testing utility. I tested my SD card, and it resulted in a composite score of 1070. Not bad. I went through the procedure, and the new composite score for the SSD is 6550. Although reading the site, many people are reporting problems with Sabrent USB to SATA adapters, like they won't boot. Guess what I have, yep, Sabrent. Well, I did get it to work with no problems, but regardless, I ordered a new one based on the ASMedia ASM115X chipset instead of the JMicron that's in the Sabrent. So add $12.99 to the total.
Funny though, even though I read a speed of about 6x what the SD card is with the SSD, it still boots to music in about the same amount of time as before.
At least I know I can feel better about not having all the random writes to an SD card and it getting corrupted.
I'm hoping that the new adapter that's arriving Wednesday will increase the speed even further and make the boot faster. I still need to look into some cooling and maybe overclocking.
Still no sign of the timer relays or the temperature sensor.
|
|
|
Post by jhornbr225 on Apr 14, 2020 14:57:06 GMT -5
Well, I started to do a little research into the RTC today, and I'm glad I did. It seems that there is a common design flaw in the cheap DS3231 modules you buy on Ebay. It ends up most vendors that copy designs add parts to supposedly "charge" the battery. The problem is that there were two batteries that go into these things, a lithium cell, and a CR2032 cell. Well, using a simple diode and resistor to charge a lithium cell is not good. They have a very specific charging method, and that is not accomplished by a simple diode/resistor combo. And if you put a CR2032 battery in it, you should not attempt to charge it at all, dire consequences may result. So, the simple solution is to not hook up VCC, and strictly use the CR2032 battery. That will allow the battery to last for months, maybe even a year. Other people are removing either the diode or the resistor, essentially breaking the charging circuit. The battery will then last longer, and not get damaged by attempting to charge it. Then I found this guy: thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/He has done a lot of experiments with these cheap boards. By making a few simple mods, he's found a way to make the batteries last for years, and still use the power from VCC when the device is powered up. I think his project uses some AA batteries as his VCC, and I'll be using the 3.3V from the Pi, but that's the only difference. 1. Lift the VCC pin from the chip, and jump it to ground. You lose the ability to drive some of the oscillator outputs of the chip, but as I won't be using them anyway, no big loss. Also my cheaper -M chip, not the better -NS chip, does not have those outputs anyway. 2. While jumpering that VCC pin to ground, use a leg from a 104 capacitor, which is actually suggested in the datasheet, but not included on the board, to stabilize the battery power, preventing "switch bounce" while inserting a battery. That's known to confuse the chip and reset some registers. They actually suggest changing the battery with the power on, so the memory does not get lost or corrupted. That's great as long as you don't drop the metal battery onto your circuit board. In the old days I used to work on a DC motor drive that had such a setup. There was an EEPROM battery that needed changed occasionally so that parameters didn't get lost when the power was off. You had to be sure not to drop that battery. One customer went to change the battery and pulled hard enough to break the battery holder. That was a mess. 3. Remove the resistor that supplies current to the power LED. Do you really need a light on all the time? 4. Cut the edge if the board away that ends up cutting the trace that goes from the Battery + to the VBAT of the chip. 5. Add another 1N4148 diode from the Battery + to the VBAT pin. Also tie the other pin of the 104 capacitor to that junction. That diode ends up jumping over the cut you just made in the trace between the B+ and the VBAT pin. By making those mods, it lowers the current required by the chip to like 3uA when not communicating via i2c, and he says the battery can last 4-5 years, and he's doing datalogging. Since I'll only be hitting the i2c comms when the Pi is powered anyway, the rest of the time it will just be in timekeeping mode. This mod essentially makes it like any motherboard schematic that I've seen, two diode cathodes meeting, one from the battery, one from the VCC supply. As long as VCC is on, no current comes from the battery. When VCC is gone, battery gets about 3uA pulled. That's why the backup battery in your PC lasts so long. Now, do I have any 1N4148's laying around? EDIT: Ordered 100 1N4148 on ebay, US shipper in California. $5.30 total. Amazon shows USB3 to SATA adapter is in the mailbox, just need to go out and get it.
|
|
|
Post by jhornbr225 on Apr 15, 2020 18:44:49 GMT -5
Hooked up the new USB3 to SATA cable. No change in boot times. Still playing local music 26 seconds after applying power.
I tried hooking the Pi to my NAS to copy over some local music, but couldn't get it to connect, even with the same stuff I did with some other Pi's. Oh well. Problem is that a Windows machine can't see the directories that the Pi can. So I booted up the Pi Boombox, and plugged the USB3 to SATA adapter into it. Then I was able to copy music into the proper directory. I don't think it will play the local music with the voice commands though, only the stuff coming Bluetooth from the phone.
I ended up getting a text while I was playing with the Open Auto Pro Pi. I know it's just a function of Open Auto, but I had several back and forth texts with nothing but my voice. I've never done that before, and it's pretty cool.
Still no sign of or tracking number updates on the timer relay or the temperature sensors. Diodes shouldn't be too long, coming from California.
I'll probably put the temperature sensor on the inside of the truck, as it has an external temperature readout up on the map light housing. It had actually quit working a few years ago, and I never thought much about it. One day, I did, and a quick google search showed that it was a common problem with loose solder joints, since it's up near the roof of the truck. A few minutes with the soldering iron, and it was fixed.
I was doing some reading about shaving some width off the glass of the Pi's touchscreen. It's just a few millimeters too wide to fit a standard Double DIN. Basically all that I could find on it said not to risk it. It appears to be hardened, and very easy to crack. So I will have to get a little creative on the mounting.
|
|
|
Post by jhornbr225 on Apr 30, 2020 15:39:55 GMT -5
Well, the DS18B20 temperature sensor showed up today. I don't know why it took so long. I ordered it 3/16, and the tracking showed that arrived in the US on 4/3, and left customs on 4/7. Other stuff I ordered from China on the same day was here in like 10-12 days.
Still waiting on the timer relay. I ordered that on 3/20.
Diodes showed up earlier in the week. Another surprise as they came from California. They were ordered on the 14th, supposed to be here between the 17th and the 21st. They arrived on the 28th, a week late.
So now I have diodes and a temp sensor, so I can play a little more. I can make the mods to the RTC, and test the temp sensor.
I also ordered and received an aux input module for the truck. I re-ordered the one I had ordered and returned about 3 years ago. I had used one similar in my Accord for a while, and it worked pretty well while using a USB stick. In the Accord it accurately showed me the folder number and track number, and provided that I used COM's Copy in Order utility to write music to the USB stick, it would play the files in the proper order.
For some reason the one for the truck was terrible. If I remember properly, it played songs in the wrong order, things on the display were very inconsistent. It was aggravating, so I returned it. Now my plan is to use the Aux jack part of it, not the USB reader. I don't care what the display says, as I'll have the Pi screen to show me everything. This will also keep the wife happy with not tearing up the truck. And bonus keeping the factory stereo, I don't have to lose FM Radio, or jump through hoops to get it to work with the Pi. Not that I listen to it, but she does. I've read in the reviews that the output level is not quite what it should be, as reported by some people, but if it's low, I can fix that with a little op-amp, probably. Some reviews said it was just as loud as a regular CD. In an ideal world, I could figure out the protocol that data is being sent to the Factory stereo's display, and piggyback my own text onto the screen with an Arduino. That would be cool.
I had done some reading on a Tacoma forum, and I found a long thread where a guy had opened his stereo up, and soldered onto the pads where the audio signal came from the actual CD player mechanism. By hooking up a cable there, he could insert a CD, and then play audio from an MP3 player, or a phone, and it would over-ride the CD audio. Although if the signal from the Aux source was weak, the CD sound would bleed through. So people starting making "Silence CD's" to get rid of that bleed through. The problem with that is that a CD is spinning the whole time you are on Aux.
This module does about the same thing, I think. Except for it has extra wires that probably tells the stereo's logic that a CD changer is hooked up, so going to CD mode does not require a CD to be in the radio at all. I'll have to try it.
|
|