whitfijs-jw / Volvo240-DigitalDash

Volvo 240 Digital Dash Project. It's not much, but its honest work.
MIT License
43 stars 6 forks source link

Network not coming up on Rev B hardware #36

Open whitfijs-jw opened 1 year ago

whitfijs-jw commented 1 year ago

To boot can0 + mcp2515 in config.txt in boot partition had to be disabled.

Check if network interfaces needs to be tweaked as well to remove can0 bringup

whitfijs-jw commented 1 year ago

These are the changes made to /etc/network/interfaces on rev B hardware that resulted in eth0 working again:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
      address 192.168.42.2
      netmask 255.255.255.0

#auto can0
#iface can0 inet manual
#    pre-up /sbin/ip link set can0 type can bitrate 500000 triple-#sampling on restart-ms 100
#    up /sbin/ifconfig can0 up
#    down /sbin/ifconfig can0 down
EvripidesKarseras commented 1 year ago

Hi,

I am having difficulty getting the network working on the rev B hardware. This is the first time I am trying this whole buildroot/pi deal.

When the whole thing was compiling I got an error about the sftp server not finding python 2.4 or better and I applied a fix I found on the buildoort mailing list. Ended up finishing succesfully generating the image.

Bit off topic but, I haven't got the custom boards/adc/etc, would that mean that the app will not just fire up on the pi? I haven't read any of the code yet btw so don't really know how the whole state machine is supposed to work.

Thanks for the work you've put into this. It is brilliant.

Regards, Evros

whitfijs-jw commented 1 year ago

Hey! I'll have to test with a bare pi to see what happens -- it's been a little while since I've done bench testing. From what I remember, the only thing that holds the eth0 network from starting is the can0 interface failing to come up. Otherwise, I don't think the app really cares if any of the other devices are present -- I will verify this on the bench as soon as I can.

First things first, can you tell me what your setup is?:

Another thing to verify is that you've gone through setting up your network manager (assuming you're using some version of ubuntu):

Remote Access

SSH (ethernet)

After boot the pi will be configured with a static ip address of 192.168.42.2. Assuming you're running a version of linux that has network-manager you can run some variation of the following after connecting the pi to your computer with an ethernet cable:

nmcli con add con-name dash-target type ethernet ifname ip4 192.168.42.1/24

nmcli con up id dash-target

You can find your ethernet interface by running:

ip addr show

You're looking for something like enp2s0 or eth0 depending on your flavor of linux.

After setting everything up you can test the connection using:

ping 192.168.42.2

on the host machine and then run:

ssh root@192.168.42.2

and enter the default credentials

EvripidesKarseras commented 1 year ago

Hi J,

Thanks for replying. I tried to sign up on the forum but I could not reach you via pm so I thought I'd write you over here.

Short story, I began building something similar in a bare-metal fashion with embedded graphics libraries, etc, but it is taking ages and the result is going to need a lot of work to reach Qt levels of eye-candiness. I bumped on your project on instagram/etc. and thought I'd give it a go. When I first started considering a digital dash I didn't think you'd get fast enough boot times. This qt/buildroot/pi thing is too softwarey for my skills. I digress.

  1. I am using a pi4 B, 8GB currently on sale at mouser.
  2. I haven't got a dedicated screen yet, I am using the pc monitor.
  3. I am using the main branch. I am not well versed in Git, I only know the basics.

Let me know if you want to be contacted elsewhere.

Cheers, Evros

whitfijs-jw commented 1 year ago

Sorry, I didn't get any notifications on the tb forums, not sure whats up -- if we can work it out on here maybe it'll help someone with a similar issue in the future.

I've done a fair amount of work with stm32's and LVGL so I get not wanting to go through the hassle of low level firmware development on something like this.

Back on task: Does anything come up on screen? I tested with a pi 400 on the bench with nothing attached and everything started alright.

The only change I had to make was that I edited the file /etc/network/interfaces on the rootfs partition of SD card so that the can0 setup is either deleted or commented out. That should allow the network to come up on eth0 at 192.168.42.2. The current buildroot image doesn't have any wifi drivers, as an attempt at boot time optimization, so you'll have to plug in an ethernet cable to your host computer.

EvripidesKarseras commented 1 year ago

Hi J,

  1. I managed to sort the network out by commenting out the can0 interface.
  2. The display issue got resolved by me not being an idiot and plugging the cable in the wrong port!

Thanks for jumping in. I am slowly starting to get the hand of this OS thing, I never worked with anything at such a high level.

Have you got any idea what sort of peculiar resolutions does the pi support? If I can get one that integrates in my dash nicely I will proceed. This is not for a volvo so some extra development is needed on the hardware side.

Cheers, Evros

whitfijs-jw commented 1 year ago

Good news! I started this project to get more familiar with buildroot and embedded linux in general. It took a little while to figure out what's going on and can be time consuming to rebuild images constantly.

The screen that fits the 240 almost perfectly is a 12.3" 1920x720 (amazon link) that I drive at 1280x480 to keep asset sizes a little smaller so the Qt app boots a little faster. You can manually edit the config.txt file in the boot partition of the SD card. The section you can play around with is, specifically the hdmi_cvt line:

#hdmi_safe=1
hdmi_cvt 1280 480 60 5 0 0 0
hdmi_group=2
hdmi_mode=87 
hdmi_force_hotplug=1
config_hdmi_boost=4

HDMI mode 87, group 2 is meant for custom configurations (more info here). Once you have a screen you want and a config that works you can go into buildroot/boards/volvodash/ and edit the config-rpi4.txt file to match the changes you've made on the SD card. That way any future buildroot images you generate will already have your changes.