Running Virtualhere on Boot

12 posts / 0 new
Last post
Sebbe
Running Virtualhere on Boot

Hi
I´m trying to get Virtualhere to run on Boot at my RaspberryPi Zero

I´m installing using the scrip at https://github.com/virtualhere/script
An as far I can understand from the FAQ Virtualhere should run at boot if it was installed by the script but it dosen´t.
I´m running a Pi Zero with Zero4U usb HAT. Connection is a 4G LTE USB modem and it works fine to ssh into the machine but when i do ps -A there is no vhusbdarmpi there.
Any sugestions?

Michael
.

What does

systemctl status virtualhere

say?

Sebbe
● virtualhere.service -


● virtualhere.service - VirtualHere Server
Loaded: loaded (/etc/systemd/system/virtualhere.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Mon 2021-04-26 21:56:48 CEST; 10h ago
Process: 238 ExecStart=/usr/local/sbin/vhusbdarmpi -b -c /usr/local/etc/virtualhere/config.ini (code=exited, status=0/SUCCESS)
Main PID: 307 (code=killed, signal=SEGV)

apr 26 21:56:20 readout1 vhusbdarmpi[238]: Using configuration /usr/local/etc/virtualhere/config.ini
apr 26 21:56:23 readout1 systemd[1]: Started VirtualHere Server.
apr 26 21:56:25 readout1 vhusbdarmpi[307]: Server licensed to=unlicensed max_devices=1
apr 26 21:56:25 readout1 vhusbdarmpi[307]: Using large URB's
apr 26 21:56:25 readout1 vhusbdarmpi[307]: Listening on all network interfaces at TCP port 7575
apr 26 21:56:25 readout1 vhusbdarmpi[307]: Found High speed device [12d1:1506] "HUAWEI Technology, HUAWEI Mobile" at address 113
apr 26 21:56:25 readout1 vhusbdarmpi[307]: Found Full speed device [10c4:800a] "Silicon Labs, SPORTident USB to UART Bridge Controller" at address 114
apr 26 21:56:48 readout1 vhusbdarmpi[307]: VirtualHere 4.2.9 caught signal 11 (Segmentation fault) and must exit. Sorry for the inconvenience, please contact
apr 26 21:56:48 readout1 systemd[1]: virtualhere.service: Main process exited, code=killed, status=11/SEGV
apr 26 21:56:48 readout1 systemd[1]: virtualhere.service: Failed with result 'signal'.

Michael
.

Its very unusual to have a segfault in virtualhere. Usually its some kernel bug.

Could you try the vhusbdarm binary like this

1. First uninstall the current server like this curl https://raw.githubusercontent.com/virtualhere/script/main/uninstall_server | sudo sh

2. Then can you install the generic server like this

curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh

See if that still crashes when you reboot the pi0w.

If it still crashes can you run the server manually like this

sudo /usr/local/sbin/vhusbdarm

and see if it runs

Sebbe
Same fault as before whith

Same fault as before whith Generic Server

systemctl status virtualhere
● virtualhere.service - VirtualHere Server
Loaded: loaded (/etc/systemd/system/virtualhere.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2021-04-27 12:25:49 CEST; 27min ago
Process: 270 ExecStart=/usr/local/sbin/vhusbdarm -b -c /usr/local/etc/virtualhere/config.ini (code=exited, status=0/SUCCESS)
Main PID: 270 (code=exited, status=0/SUCCESS)


apr 27 12:24:52 readout1 systemd[1]: Started VirtualHere Server.
apr 27 12:24:54 readout1 vhusbdarm[270]: >>> Starting VirtualHere USB Server v4.3.0 (Built: Apr 27 2021, 08:41:27)<<<
apr 27 12:24:55 readout1 vhusbdarm[270]: Using configuration /usr/local/etc/virtualhere/config.ini
apr 27 12:24:59 readout1 vhusbdarm[300]: Server licensed to=unlicensed max_devices=1
apr 27 12:24:59 readout1 vhusbdarm[300]: Using large URB's
apr 27 12:24:59 readout1 vhusbdarm[300]: Listening on all network interfaces at TCP port 7575
apr 27 12:24:59 readout1 vhusbdarm[300]: Found High speed device [12d1:1506] "HUAWEI Technology, HUAWEI Mobile" at address 113
apr 27 12:24:59 readout1 vhusbdarm[300]: Found Full speed device [10c4:800a] "Silicon Labs, SPORTident USB to UART Bridge Controller" at address 114
apr 27 12:25:49 readout1 vhusbdarm[300]: VirtualHere 4.3.0 caught signal 11 (Segmentation fault) and must exit. Sorry for the inconvenience, please contact mail
apr 27 12:25:49 readout1 systemd[1]: virtualhere.service: Succeeded.

And it runs fine on sudo /usr/local/sbin/vhusbdarm

Michael
.

Ok so if it runs fine manually after its all booted then it must be some boot service it is missing.

Could you edit the /etc/systemd/system/virtualhere.service and change the After line and add a line after that like this

After=network-online.target
Wants=network-online.target

Then save the service file and reload like this

systemctl daemon-reload
systemctl enable virtualhere.service

Then power off/on your pi0w and see if it starts ok now

Sebbe
Same problem now.

Same problem now.

Michael
.

Im re- testing raspbian on my pi0w but i cant seem to find a bootable image. The one from the raspberrypi website doesnt work with the pi0w. The pi0w wont boot and nothing in the serial console either.

Where did you download your raspbian image from for the pi0w?

Sebbe
I ran the raspberry pi imager

I ran the raspberry pi imager.
I don´t have p0w i only have p0

Michael
.

OK that is the issue then. VirtualHere needs to have a network interface up before it starts. It wont start with no network interface at all.

So you need to run virtualhere after your modem is initialized. You cannot run that boot script, you need to write a custom script to do that. I dont know much about your modem other than you need to run a script to start virtualhere if it has a network interface in /sys/class/net (not including lo)

Sebbe
I use a USB ethernet device

I use a USB ethernet device but mabey that is initilized to slow to then?
I´m using that during my config and testing. Later the point is that the Pi, a mobile broadband and a "SportIdent Device" are going to work as a Online Readout for Orienteering courses.

Michael
.

Yes virtualhere needs to start after at least one interface has been created by the linux kernel during boot. It doesnt need to actually connect to a network. I just needs to exist in /sys/class/net

Normally a linux box has at least one network interface that the kernel boots and thats why virtualhere has a "After=network.target" in the script. However there is no network interface built-into the board so virtualhere cant start.

Have a look here https://raspberrypi.stackexchange.com/questions/92177/what-is-a-proper-w...

Log in or register to post comments