Reply
 
Thread Tools Display Modes
 
Old 10-10-2017, 12:40 PM   #381
Bus Geek
 
Join Date: May 2009
Location: Columbus Ohio
Posts: 9,117
Year: 1991
Coachwork: Carpenter
Chassis: International S3800
Engine: DT360
Rated Cap: 7 Row Handicap
Quote:
Originally Posted by Rusty View Post
Thanks for the pdf. I can get one of those interfaces/cable you suggested and be willing to help anyway I can.

my thought is to use a USB to serial converter, connect that device to a raspberry PI and then use Python / QT to create some type of a digital-dash layout.. im thinking even with a screen we ought to be able to come in way under cost wise what the silverleaf device and a windows tablet costs.. wont be as elegant.. and people would need to know how to build screens in QT to arrange their dash layout.. unless we did some type of AJAX web-style App and they could use ipads, their phone / android tablet etc...

could even do the data acquistion in PHP ( I can write that in my sleep.. ive written complete hotel computer system interface stacks in PHP-CLI).. Python just has a nice QT connector... and QT is a decent GUI stack..

im open to lots of ideas here.
-Christopher
cadillackid is offline   Reply With Quote
Old 10-10-2017, 12:55 PM   #382
Bus Crazy
 
Join Date: Feb 2012
Location: Salt Lake City Utah
Posts: 1,367
Year: 2000
Chassis: Blue Bird
Engine: ISC 8.3
Sounds nice. I've always needed a good reason to learn Qt..

What about a display? I've always thought a used tablet from eBay would be a good low-cost option. I haven't looked, but I suppose surely there must be 8 to 11 inch diagonal displays for in-car entertainment that would have an HDMI input the Pi could feed. Though that display would surely cost more than an old cast-away Android tablet, it would simply the software side by eliminating the need to write an Android app and API between the app and Pi.
family wagon is offline   Reply With Quote
Old 10-10-2017, 01:26 PM   #383
Bus Geek
 
Join Date: May 2009
Location: Columbus Ohio
Posts: 9,117
Year: 1991
Coachwork: Carpenter
Chassis: International S3800
Engine: DT360
Rated Cap: 7 Row Handicap
Quote:
Originally Posted by family wagon View Post
Sounds nice. I've always needed a good reason to learn Qt..

What about a display? I've always thought a used tablet from eBay would be a good low-cost option. I haven't looked, but I suppose surely there must be 8 to 11 inch diagonal displays for in-car entertainment that would have an HDMI input the Pi could feed. Though that display would surely cost more than an old cast-away Android tablet, it would simply the software side by eliminating the need to write an Android app and API between the app and Pi.
I have a 7 inch 12 volt display I bought cheap from somewhere. Ill have to look it up.. ive also got a PI-designed touchscreen as well.. thinking that way I could use the PI for other stuff too if I wanted.. eventually my switch panel (or most of it) will go away in favor of an automated solution for my A/C, heat, etc.. somewhereinusa has a nice setup he has crated for switches and such based on an arduino (UNO).. he has bluetooth connectivity on his.. I just like the idea of a more screen based solution.. and for engine displays thats necessary. on RedByrd i would like to ditch those 2 tablets I have in favor of something else that I could then turn that part of my dashboard into ducting for dashboard A/C vents..
-Christopher
cadillackid is offline   Reply With Quote
Old 10-10-2017, 03:33 PM   #384
Traveling
 
Join Date: Nov 2015
Location: Midwest
Posts: 2,573
Year: 2003
Coachwork: BlueBird
Chassis: TC2000
Engine: 5.9L Cummins
Rated Cap: '00
Quote:
Originally Posted by cadillackid View Post
my thought is to use a USB to serial converter, connect that device to a raspberry PI and then use Python / QT to create some type of a digital-dash layout.. im thinking even with a screen we ought to be able to come in way under cost wise what the silverleaf device and a windows tablet costs.. wont be as elegant.. and people would need to know how to build screens in QT to arrange their dash layout.. unless we did some type of AJAX web-style App and they could use ipads, their phone / android tablet etc...

could even do the data acquistion in PHP ( I can write that in my sleep.. ive written complete hotel computer system interface stacks in PHP-CLI).. Python just has a nice QT connector... and QT is a decent GUI stack..

im open to lots of ideas here.
-Christopher
Ideally skip the Pi and go straight USB to the Droid tabby. We all have Nexus 7 or old Kindles laying around. Tablet also could do GPS, backup cam, etc.

I'm nowhere near your programming abilities, but used to hack legacy serial comm stuff. So, to that end, I will post some stuff and let you refute why it won't work

My simplistic approach is:

1) Get the data into the tablet Utilizing that reader, then serial to usb dongle

Android USB host serial driver library for CDC, FTDI, Arduino and other devices


2) You mentioned you like PHP, so we gotta get that running on same device. Database is nice for data recording, mins/max, etc.

Server for PHP

3) So, ideally you have a device feeding your database by now. Time to make it GUI.

Slap-together user interface using your preferred tools.


May have glossed-over some minute details....

sew.jpg
Rusty is offline   Reply With Quote
Old 10-10-2017, 03:39 PM   #385
Skoolie
 
Join Date: May 2017
Location: Lake geneva Wisconsin
Posts: 199
Year: 93
Coachwork: Amtran
Chassis: International
Engine: 7.3 idi
The pi is awesome cause you can play old school video games on it. Wish i could wrap my tiny brian around this stuff. Cause i love it. Definitely would like a set up in my rig
Greatestrr is offline   Reply With Quote
Old 10-10-2017, 04:11 PM   #386
Traveling
 
Join Date: Nov 2015
Location: Midwest
Posts: 2,573
Year: 2003
Coachwork: BlueBird
Chassis: TC2000
Engine: 5.9L Cummins
Rated Cap: '00
Quote:
Originally Posted by Greatestrr View Post
The pi is awesome cause you can play old school video games on it. Wish i could wrap my tiny brian around this stuff. Cause i love it. Definitely would like a set up in my rig
I've got my old Wii with a loader and 1200 games for mobile fun, but that'll be on the 4K Samsung I scored last Black Friday or whatever that sale is.

As you can tell, am reluctant to learn technology any more- seem to have reached a saturation point??? Something something Luddite.
Rusty is offline   Reply With Quote
Old 10-10-2017, 05:07 PM   #387
Bus Nut
 
Tootalltechie's Avatar
 
Join Date: Jul 2016
Location: Prince George, BC, Canada
Posts: 505
Year: 1974
Coachwork: Bluebird
Chassis: CHEVROLET C60 just under 19700 lbs body#B10353
Engine: 350 ci on propane
Rated Cap: 48
If you dismantle a LED tv/display that has HDMI input you will find a circuit board, a light box, a flexible mylar display, and the front glass/plastic screen. Granted you can not cut down the square mylar display but you could curve it into a custom shape. Then drive the display with raspberry pi or any other maker board. To see what is on the display you would have to make a light box.
Just thinking out of the box.
Gordon

Sent from my SM-G530W using Tapatalk
Tootalltechie is offline   Reply With Quote
Old 10-10-2017, 07:10 PM   #388
Skoolie
 
Join Date: May 2017
Location: Lake geneva Wisconsin
Posts: 199
Year: 93
Coachwork: Amtran
Chassis: International
Engine: 7.3 idi
Now that sounds like some fun tinkering.
Greatestrr is offline   Reply With Quote
Old 10-11-2017, 01:17 PM   #389
Bus Geek
 
Join Date: May 2009
Location: Columbus Ohio
Posts: 9,117
Year: 1991
Coachwork: Carpenter
Chassis: International S3800
Engine: DT360
Rated Cap: 7 Row Handicap
only reason im not going android is having to deal with all the different versions out there.. and if a particular tab has a USB HOST port on it or just a client port..

I just hooked up the HDV100A3 to the J1939 bus and got readable data from it.. now im writing a crude program to decode the data into PGN's and SPN's. I did a couple manually and saw TCM and ECM data intermingled which is exactly what I was hoping to see. CANJ1939 operates at 250,000 bps and the HDV100A3 operates at 115,200 bps by default. .. seems like a recipe for disaster to me... it can operate at 460kbps assuming that the host PC and application can also operate at that speed.. not all USB to serial chipsets can go that fast. the one I use in my business (so of course the one I test with) can. so I am running at 460kbps on my host now.

Large Selection of USB-RS232 adapters, Easy Installation and Setup of USB RS232 COM ports.

J1939 messages are pretty easy to shred assuming you know how to tear things apart bit by bit...

so the HDV sends me a sequence as such

01 05 02 10 89 92 1D 0D 67 80 18 00 08 FD 09 00 FF FF FF FF FF 65

01 05 02 - the HDV telling me it is sending me a message from the J1939
10 89 92 1D - four byte time stamp
0D - tells me there are 13 data bytes (each set of numbers is a byte, 8 bits, a number from 0-255)

so I crudely parsed some Live J1939 data with a PHP-CLI script. I captured the data using a term program saved to a text file, then parsed the file with PHP..

the engine was running and then I shut it off.. I was able to read the engine control mode (came back as foot pedal..) and the engine RPM.. parsing PGN's is just data lookup.. its nothing that can be done easily progmatically without some type of Lookup DB.. either just inbred tales or a DB onboard.. this is opposite the type of coding I like..(I normally like re-usable routines or objects).. but this is par for the course in ECM / PCM / TCM protocols and hacking..

an example of the Raw data from the HDV100A3 device capturing the J1939.

Code:
01 05 02 0B 48 23 33 0D 67 80 18 00 08 FD 00 00 FF FF FF FF FF BD
01 05 02 0B 48 24 9B 0D C7 F7 70 00 08 59 FF B0 27 FF FF FF FF 88
01 05 02 0B 48 26 04 0D C7 80 00 78 08 F0 FF FF FF FF FF FF FF 42
01 05 02 0B 48 27 71 0D C7 F7 88 00 08 FF FF FF FF FF FF FF FF 46
01 05 02 0B 48 28 DE 0D C7 F7 B8 00 08 FF FF FF FF FF FF FF FF E4
01 05 02 0B 48 2A 4B 0D C7 F7 B0 00 08 FF 00 FF FF FF FF FF FF 4C
01 05 02 0B 48 2B B6 0D C7 F7 78 00 08 FF FF FF 00 FF FF FF FF 80
01 05 02 0B 48 2D 1E 0D C7 F7 A8 00 08 C5 FF FF FF FF 44 FF FF 24
The RUDE and CRUDE PHP script.. alas this is hacked together just as a Proof-of-concept to see if I could read and parse data from my engine.
Code:
#!/usr/bin/php
<?php
## saved data from the HDV
$rr = file_get_contents("j1939-fast.txt");
# every message starts with 01 05 02 hex so we break apart our message there and get our data.
$ggg = explode("01 05 02",$rr);

##     [13090] =>  0D 48 7A 2F 0D 67 80 60 18 08 00 FB FF FF FF FF FF FF 6F
##     [13091] =>  0D 48 97 30 0D 67 80 10 18 08 C0 00 00 FF F7 00 00 03 01
#                 | timestamp |DL| PGN ID    | SPN DATA & node ID       |CS|
#                                |  data specified by DL                |

# timestamp - 4 byte HDV originated time.
# DL - number of data bytes (includng PGN ID) in Hex (0D = 13)
# PGN ID - 18 bits
foreach ($ggg as $raw1939) {
  # get rid of any mis spaces at begin or end of string
  $rawbreak = trim($raw1939);
  # echo "|".$rawbreak."|\n";
  ## get our data length.
  $hexdl = substr($rawbreak,12,2);
  # make it decimal
  $decdl = base_convert($hexdl,16,10) * 3;
  ## get the data minus the 4 PGN ID bytes
  $rawhexdata = trim(substr($rawbreak,30,($decdl - 16)));
  # to get the PGN ID we need to be after the Data length and timestamp and just the 4 bytes (32 raw bits)
  # which contains the PGN ID.
  $rawpgn = substr($raw1939,15,12);
  # delete the spaces in the record format
  $drr= str_replace(" ","",trim($rawpgn));
  $rawpgn = $drr;
  # convert the 4 byte Hex number to Binary.
  $binpgn = base_convert($rawpgn,16,2);
  # base convert leaves out the leading 0, so we add it if the value doesnt start with a 1.
  # for a total of 32 bits to work with.
  $binpgn = str_pad($binpgn,32,'0',STR_PAD_LEFT);
  # echo $binpgn."\n";
  # echo "67 - ".base_convert("67",16,2)."\n";
  # echo "C7 - ".base_convert("C7",16,2)."\n";
# below is the Binary breakout of the first 4 bytes after DL.
#     67       80       10       18
#  01100111 10000000 00010000 00011000
#  011 0 0 111 10000 00010000 00011   000
#     |   PGN here 18 bits   |       |Ign|
# get the 18 bits we need
$binpgnbreak = substr($binpgn,3,18);
# turn it to decimal
$decpgn = base_convert($binpgnbreak,2,10);
# echo $binpgnbreak." - ".$decpgn."\n";
/*
Electronic Transmission Controller #1 ETC1
Reception Rate : 10 ms
Data Length: 8 bytes
Data Page: 0
PDU format: 240
PDU specific: 2
Default priority: 3
PGN: 61442 (0x00F002)
Byte :  1 - Status_ETC1
   Bits: 8,7 - Not Defined
   Bits: 6,5 - Shift in Progress (SPN 574)
     00: - shift is not in process
     01: - shift in process
     11: - N/A
   Bits: 4,3 - Torque Converter Lockup Engaged (SPN 573)
     00: - Torque Converter Lockup Disengaged
     01: - Torque Converter Lockup Engaged
   Note:  Rel 38.0 or later
   Bits: 2,1 - Driveline Engaged
     00: - Driveline Disengaged
     01: - Driveline Engaged
     11: - N/A
Byte:  2,3 - Output Shaft Speed (SPN 191)
   Resolution: - 0.125 rpm / Bit, 0 rpm offset
Byte:  4 - Percent Clutch Slip - N/A
Byte:  5 - Command_ETC1
   Bits: 8-5 - Not Defined
   Bits: 4-3 - Progressive Shift Disabled (SPN 607)
     00: - Progressive Shift Is Not Disabled
     01: - Progressive Shift Is Disabled
     11: - N/A
   Bits: 2,1 - Momentary Engine Overspeed Enable (SPN 606)
     00: - Momentary Engine Overspeed Is Disabled
     01: - Momentary Engine Overspeed Is Enabled
     11: - N/A
Bytes: 6,7 - Input Shaft Speed - N/A
Byte:  8 - Source Address of Controlling Device for Transmission
   Control N/A
*/
## now lets try to break apart a PGN 61442 because its
## Transmission related info from the ECM.
switch ($decpgn) {
  case "61442":
    ## the SPN's in this PGN use 8 bytes per the spec.
    echo "GOT 61442 - $rawhexdata\n";
    break;
  case "61444":
    # F1 FF FF 04 10 FF FF FF #
    #  11110001 11111111 11111111 00000100 00010000
    ## the SPN's in this PGN use 8 bytes per the spec
    echo "GOT 61444 - $rawhexdata\n";

    # grab byte 1 - supported by Navistar.
    # last 4 bits are of use.
    $byte1 = substr($rawhexdata,0,2);
    $byte1 = str_pad(base_convert($byte1,16,2),8,'0',STR_PAD_LEFT);
    echo "SPN: 899 Engine control mode: ".substr($byte1,4)."\n";
    ## bytes 2 and 3 unsupported. they are sent as FF in all of my captures

    ## bytes 4 and 5 are the engine RPM data.
    $byte4 = substr($rawhexdata,9,2);
    $byte5 = substr($rawhexdata,12,2);
    ## get a decimal number for our hex. bytes need reversed per spec
    $rpmdec = base_convert($byte5.$byte4,16,10);
    echo "SPN: 190 Engine RPM Raw: $rpmdec  Human = raw X 0.125  Real RPM:".$rpmdec*.125."\n";




    break;
}
}
# print_r($ggg);

?>
The output of the PHP script. when I turned the engine off. the ECM cntinued to transmit to the TCM as the RPM spun down.
Code:
GOT 61444 - F1 FF FF E0 15 FF FF FF
SPN: 899 Engine control mode: 0001
SPN: 190 Engine RPM Raw: 5600  Human = raw X 0.125  Real RPM:700
GOT 61442 - C0 00 00 FF F7 7E 13 03
GOT 61442 - C0 00 00 FF F7 7E 13 03
GOT 61444 - F1 FF FF C0 15 FF FF FF
SPN: 899 Engine control mode: 0001
SPN: 190 Engine RPM Raw: 5568  Human = raw X 0.125  Real RPM:696
GOT 61442 - C0 00 00 FF F7 7C 13 03
GOT 61444 - F1 FF FF EA 14 FF FF FF
SPN: 899 Engine control mode: 0001
SPN: 190 Engine RPM Raw: 5354  Human = raw X 0.125  Real RPM:669.25
GOT 61442 - C0 00 00 FF F7 7C 13 03
GOT 61442 - C0 00 00 FF F7 5A 13 03
GOT 61444 - F1 FF FF 00 14 FF FF FF
SPN: 899 Engine control mode: 0001
SPN: 190 Engine RPM Raw: 5120  Human = raw X 0.125  Real RPM:640
GOT 61442 - C0 00 00 FF F7 5A 13 03
GOT 61444 - F1 FF FF C6 12 FF FF FF
SPN: 899 Engine control mode: 0001
SPN: 190 Engine RPM Raw: 4806  Human = raw X 0.125  Real RPM:600.75
GOT 61442 - C0 00 00 FF F7 14 13 03
GOT 61442 - C0 00 00 FF F7 14 13 03
GOT 61444 - F1 FF FF D2 11 FF FF FF
SPN: 899 Engine control mode: 0001
SPN: 190 Engine RPM Raw: 4562  Human = raw X 0.125  Real RPM:570.25
-Christopher
cadillackid is offline   Reply With Quote
Old 10-11-2017, 03:51 PM   #390
Bus Geek
 
Join Date: May 2009
Location: Columbus Ohio
Posts: 9,117
Year: 1991
Coachwork: Carpenter
Chassis: International S3800
Engine: DT360
Rated Cap: 7 Row Handicap
Hacking is fun!! Of course trying to drive a bus with wires all over the place is tricky..




I used power and ground from the existing J1708 dash connector and then wired down to the j1939 for the van wires. The dash connector uses ECM reference ground which is important. Since I'm a 3rd node in the network I didn't need terminating resistor, at least it seemed to work fine without. It's possible that it's internal to the HDV device.

Update - I parsed more PGNs and now have my throttle and engine load as well as parsed the transmission responding back to the ECM with its status.
I'm still working on processing cruise status.
Christopher


Sent from my iPhone using Tapatalk
cadillackid is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


» Featured Campgrounds

Reviews provided by

Powered by vBadvanced CMPS v3.2.3

All times are GMT -5. The time now is 01:28 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.