mad_pete Posted April 1, 2017 Share Posted April 1, 2017 Car pc time again. Can someone recommend me a serial to USB cable for MS to plug into a Raspberry pi please ? Quote Link to comment Share on other sites More sharing options...
zardos Posted April 1, 2017 Share Posted April 1, 2017 I believe that the Raspberry Pi has a UART that is able to run as a serial port, so no need to Convert to and from USB Just configure the OS correctly (e.g. not to run a console on the serial) and connect to the right GPIO pins Note I've not done this myself but I'm sure a web search will tell you how. Edit: I guess that megasquirt is full RS232 and running at 12V which will need to be converted to 3.3V for a UART connection Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted April 1, 2017 Share Posted April 1, 2017 As Zardos says, the GPIO header should have 3v3 (possibly TTL compatible) serial TX/RX pins. Your MS will be running "full" RS232 at +/-12v so you'll need whatever the 3v3 version of a MAX232 chip is. Best bet check the Pi forums etc. as someone's bound to have solved this one before. Likely a ready-made board on eBay from China for a few pennies. Something like this in fact. If you do USB-Serial you want anything that uses an FTDI chip, although Linux seems to handle the rest more sensibly than windows ever did - if you only have one USB-Serial attached it is likely to always be /dev/ttyUSB0 Also - show us what you're making! Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted April 1, 2017 Share Posted April 1, 2017 ...also these guys make a good point about turning off the system console on that port if you're using the serial port for other things, it could proper mess you up: Quote The UART is /dev/ttyAMAO, it defaults to output system log. But if user wants to use this UART to connect to other modules through UART, for example, GPS module, we need to change the configuration. The detailed steps are as following: We need to modify two files: /boot/cmdline.txt and /etc/inittab. Modify /boot/cmdline.txt: Replace the original content: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait With: dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait Modify /etc/inittab: Comment out the last line of /etc/inittab. To comment out, it simply addess a '#'. $ sudo vi /etc/inittab T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 Save the changes, and reboot. We will get an UART with baud rate of 115200. Quote Link to comment Share on other sites More sharing options...
mad_pete Posted May 7, 2017 Author Share Posted May 7, 2017 Okay. Update. RPi v3 is very impressive. Very fast, built in wifi and Bluetooth. Nice bit of kit. Doesn't like 12v instead of 5.5v But that aside I have working: Power to the Pi from the car In car monitor TunerStudio (loads straight in, super easy) Auto shutdown from the car PSU Not yet working : Serial port - got the thing from ebay haven't it talking yet - I need to recheck the settings. Swapped controller fromthe Bluetooth to the serial Touch screen Quote Link to comment Share on other sites More sharing options...
elbekko Posted May 8, 2017 Share Posted May 8, 2017 Nice! 19 hours ago, mad_pete said: TunerStudio (loads straight in, super easy) Did you configure TunerStudio to auto start? If so, how? I never managed to get that working. Same with the auto shutdown, had some trouble with reading the GPIO pin for that IIRC. Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted May 8, 2017 Share Posted May 8, 2017 May be obvious but the Pi serial pins will be 3v3, whereas the MS RS232 output will be +/-12v. You'll need a MAX232 (possibly MAX3232 for 3v3 if memory serves) to convert levels. Plenty of ready-made boards for peanuts on eBay. Quote Link to comment Share on other sites More sharing options...
elbekko Posted May 8, 2017 Share Posted May 8, 2017 Yeah, I converted it to 3v3, I think it was mostly due to Mono being a pain on the Pi back then (maybe it still is). Quote Link to comment Share on other sites More sharing options...
Arjan Posted May 9, 2017 Share Posted May 9, 2017 To me, it's like Marsians talking.... But looks interesting ! 4 Quote Link to comment Share on other sites More sharing options...
mad_pete Posted May 9, 2017 Author Share Posted May 9, 2017 17 hours ago, elbekko said: Nice! Did you configure TunerStudio to auto start? If so, how? I never managed to get that working. Same with the auto shutdown, had some trouble with reading the GPIO pin for that IIRC. Auto start https://www.youtube.com/watch?v=-UnS-xxT0Aw&feature=youtu.be Auto stop http://www.instructables.com/id/Simple-Raspberry-Pi-Shutdown-Button/ My PSU gives me a latch on shutdown and then waits a minute before a hard power off. I put the latch pins to the GPIO pins. I'll add some pictures. I think for the serial port I might (and not for the first time) be forgetting to run Tunerstudio with a user that is allowed access to the Serial port. Quote Link to comment Share on other sites More sharing options...
mad_pete Posted June 10, 2017 Author Share Posted June 10, 2017 Can't get the serial port to work at the moment. Will go and find a rpi forum to post to. I've turned off the console and swapped the Bluetooth over. if I loop the serial gpio pins thx and extra the tunerstudio minicomm sees the chars and if I connect a laptop to the megasquirt that works hmm. Quote Link to comment Share on other sites More sharing options...
mad_pete Posted June 10, 2017 Author Share Posted June 10, 2017 It seems like the serial gender changer may need to swap tx and rx, ordering a null modem one and see what happens. if anyone has a db9 null modem cable or connector they don't want any more let me know please. :-) Quote Link to comment Share on other sites More sharing options...
zardos Posted June 10, 2017 Share Posted June 10, 2017 A long time ago I had a rs-232 jumper box, very handy. But long since lost it :-( Quote Link to comment Share on other sites More sharing options...
mad_pete Posted June 15, 2017 Author Share Posted June 15, 2017 Ok got a small null modem connector from eBay and it seems to mostly work. The dectect came back with msns or similar repeated for firmware and version and the port check fails but if I just run it the gauges do indeed spring to life. Maybe the null modem doesn't have all the loopbacks in place. So that's the most important bit. Just need to wire it in and maybe find a custom dash I like. :-). Maybe I'll see if the firmware needs an update. Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted June 20, 2017 Share Posted June 20, 2017 You should only need 3 wires for the RS232 cable: Tx, Rx, Ground. Any time a USB adapter is involved there's opportunity for problems as they can buffer data or have flow control / wrong speed etc. You'd almost be better off using the Pi's GPIO UART pins and a stock MAX3232 driver. Quote Link to comment Share on other sites More sharing options...
mad_pete Posted July 1, 2017 Author Share Posted July 1, 2017 So mostly works, did corrupt one of my fuel cell values so it's not 100% yet. Need to get the serial more reliable. 1 Quote Link to comment Share on other sites More sharing options...
geoffbeaumont Posted July 6, 2017 Share Posted July 6, 2017 That looks very tidy! Hope you get the last few gremlins ironed out. Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted July 6, 2017 Share Posted July 6, 2017 That's pretty neat (and rather bling), is it annoying at night? Quote Link to comment Share on other sites More sharing options...
mad_pete Posted July 15, 2017 Author Share Posted July 15, 2017 The pi is causing the megasquirt to reset every so often when it's connected. I think that's why I got a corrupted fuel cell. Need to fix that. I haven't tried night yet due to this. Quote Link to comment Share on other sites More sharing options...
Funky Diver Posted August 5, 2018 Share Posted August 5, 2018 Very impressive. If it's corrupting the MS, presumably there's feedback through the Rx/Tx. Simple Diode help to stop it doing that? Quote Link to comment Share on other sites More sharing options...
mad_pete Posted October 21, 2018 Author Share Posted October 21, 2018 It’s causing the ms to reset I think when the serial is connected. I thought I might need to put the earths neaer each other. Where would the diodes go ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.