F30POST
F30POST
2012-2015 BMW 3-Series and 4-Series Forum
BMW Garage BMW Meets Register Today's Posts
BMW 3-Series and 4-Series Forum (F30 / F32) | F30POST > Technical Forums > N20, N26, B46, B48 Turbo Engine / Drivetrain / Exhaust Modifications > Bootmod3 Wifi Agent DIY Alternate Method
Extreme Powerhouse
Post Reply
 
Thread Tools Search this Thread
      05-20-2020, 09:14 PM   #111
DadzBmer_N2o
First Lieutenant
DadzBmer_N2o's Avatar
United_States
93
Rep
338
Posts

Drives: F30 320ix
Join Date: Jan 2020
Location: Frederick, MD

iTrader: (0)

Quote:
Originally Posted by dieselg5 View Post
I don't understand what you mean. You can update the app on the phone and the agent running on the Pi from your phone. You only need to setup/flash the SD card on your Pi once.
Here this is directly from their BM3 site on the OBD agent updates:

"Firmware updates for the hardware OBD Agent device require pulling the microSD card out of the device for an update.

Step-by-step guide

Download firmware from here:
https://www.dropbox.com/s/91l8gqmlh0...07.img.gz?dl=0

Unzip the provided .gz file. On Windows you can use WinRAR or 7-zip software to extract the downloaded .gz file from the above link.

On macOS in most cases it’ll just unzip automatically after downloading. Unzipped file will have a .img extension and the file will be just below 8 GB in size.

Write the .img file to the card. You can use Etcher (on macOS or Windows), free utility:

Etcher:
https://www.balena.io/etcher/

Once updated, insert the microSD card back into the device and power it on to confirm connectivity."

So even the BM3 app on my iphone, in the app store >available updates, it never shows up there for newer versions, so i am confused and scratching my receding hairline as we speak, lol..
__________________
2013 320ix N20 8AT|BM3 stg1|Muff Res Delete|HPB-LED-Amber-DRL's
IG: DadzBmer_N2o

Last edited by DadzBmer_N2o; 05-20-2020 at 09:19 PM.. Reason: add more info
Appreciate 0
      05-20-2020, 09:19 PM   #112
dieselg5
Private
67
Rep
68
Posts

Drives: 2015 328i xdrive
Join Date: Jul 2018
Location: USA

iTrader: (0)

Quote:
Originally Posted by DadzBmer_N2o View Post
Here this is directly from their BM3 site on the OBD agent updates:

"Firmware updates for the hardware OBD Agent device require pulling the microSD card out of the device for an update.

Step-by-step guide

Download firmware from here:
https://www.dropbox.com/s/91l8gqmlh0...07.img.gz?dl=0

Unzip the provided .gz file. On Windows you can use WinRAR or 7-zip software to extract the downloaded .gz file from the above link.

On macOS in most cases it’ll just unzip automatically after downloading. Unzipped file will have a .img extension and the file will be just below 8 GB in size.

Write the .img file to the card. You can use Etcher (on macOS or Windows), free utility:

Etcher:
https://www.balena.io/etcher/

Once updated, insert the microSD card back into the device and power it on to confirm connectivity."
I don't know what they specifically mean by "firmware updates" but you can just update the agent from your phone. You ask anyone that's been using the agent for a while or you can try it yourself by putting and older version on your pi, open the app on your phone, it'll say the agent is out of date, you tap on update agent, and you're on the latest version.
Appreciate 0
      05-20-2020, 09:24 PM   #113
DadzBmer_N2o
First Lieutenant
DadzBmer_N2o's Avatar
United_States
93
Rep
338
Posts

Drives: F30 320ix
Join Date: Jan 2020
Location: Frederick, MD

iTrader: (0)

Quote:
Originally Posted by dieselg5 View Post
I don't know what they specifically mean by "firmware updates" but you can just update the agent from your phone. You ask anyone that's been using the agent for a while or you can try it yourself by putting and older version on your pi, open the app on your phone, it'll say the agent is out of date, you tap on update agent, and you're on the latest version.
Kay i will try this when i am connected next time to reflash back my burbles. I only say this because when i was connected with everything and went to reflash it, it said something like error OBD agent needs to be updated and wouldn't let me go any further and didn't see anything to tap for an update?? If i get this error msg next time agian, i will take a screenshot if i can...
__________________
2013 320ix N20 8AT|BM3 stg1|Muff Res Delete|HPB-LED-Amber-DRL's
IG: DadzBmer_N2o
Appreciate 0
      05-20-2020, 09:39 PM   #114
dieselg5
Private
67
Rep
68
Posts

Drives: 2015 328i xdrive
Join Date: Jul 2018
Location: USA

iTrader: (0)

Quote:
Originally Posted by DadzBmer_N2o View Post
Kay i will try this when i am connected next time to reflash back my burbles. I only say this because when i was connected with everything and went to reflash it, it said something like error OBD agent needs to be updated and wouldn't let me go any further and didn't see anything to tap for an update?? If i get this error msg next time agian, i will take a screenshot if i can...
Here's what it looks like:
Attached Images
    
Appreciate 0
      05-20-2020, 10:22 PM   #115
DadzBmer_N2o
First Lieutenant
DadzBmer_N2o's Avatar
United_States
93
Rep
338
Posts

Drives: F30 320ix
Join Date: Jan 2020
Location: Frederick, MD

iTrader: (0)

Thanks for the info, i will try this, this week 👌

Okay updated as of today (5/27/20). I did get that warning to update my agent firmware, but it was gawd awefully slow loading (i assume from it being large), so i will just end up taking the SD card out and do the firmware update on the MAC, thanks for the advice and help..
__________________
2013 320ix N20 8AT|BM3 stg1|Muff Res Delete|HPB-LED-Amber-DRL's
IG: DadzBmer_N2o
Appreciate 0
      05-28-2020, 08:33 PM   #116
edm0nd
Private
edm0nd's Avatar
23
Rep
98
Posts

Drives: 328i 2013
Join Date: Mar 2017
Location: LA

iTrader: (0)

Just purchased a rpi4 so will be following this thread for when it comes in and I can make this for it and BM3
Appreciate 0
      05-29-2020, 02:30 PM   #117
Kid_droid
Private First Class
United Kingdom
64
Rep
134
Posts

Drives: 2013 F32 428i M sport
Join Date: Jan 2017
Location: London

iTrader: (0)

Quote:
Originally Posted by edm0nd View Post
Just purchased a rpi4 so will be following this thread for when it comes in and I can make this for it and BM3
I have an Rpi4 which I have flashed with the instructions on the first page. The app still says no OBD agent detected. I can see the RPi4 connected to my hotspot which is bootmod3.

Should my Rasbpain Lite have no desktop at all for it to work?.

Please help.
Appreciate 0
      06-06-2020, 04:23 AM   #118
Kid_droid
Private First Class
United Kingdom
64
Rep
134
Posts

Drives: 2013 F32 428i M sport
Join Date: Jan 2017
Location: London

iTrader: (0)

Any luck with Raspberry 4 ?. I'm struggling here. I do not know where I'm going wrong?.

I have managed to do this as well. Useful if you do not want cables running around or under your trim etc.

Appreciate 0
      06-06-2020, 06:23 PM   #119
DadzBmer_N2o
First Lieutenant
DadzBmer_N2o's Avatar
United_States
93
Rep
338
Posts

Drives: F30 320ix
Join Date: Jan 2020
Location: Frederick, MD

iTrader: (0)

So lately my OBD Pi3B has been giving me fits on trying to update the agent while inside the garage, this last update i ended up just taking her nearest my router and updating the agent firmware there. Well it took sometime but i left it and cameback and it updates to the latest version and haven't had any more probs doing my flashes now..

Also its weird but i still can get connected even though my phone is not named "bootmod3" in the >about settings, i do it have it named that for the hotspot name..
__________________
2013 320ix N20 8AT|BM3 stg1|Muff Res Delete|HPB-LED-Amber-DRL's
IG: DadzBmer_N2o
Appreciate 0
      06-07-2020, 05:38 AM   #120
pierreye
Lieutenant
212
Rep
500
Posts

Drives: F10 & G01
Join Date: Jun 2018
Location: Malaysia

iTrader: (0)

Quote:
Originally Posted by DadzBmer_N2o View Post
So lately my OBD Pi3B has been giving me fits on trying to update the agent while inside the garage, this last update i ended up just taking her nearest my router and updating the agent firmware there. Well it took sometime but i left it and cameback and it updates to the latest version and haven't had any more probs doing my flashes now..

Also its weird but i still can get connected even though my phone is not named "bootmod3" in the >about settings, i do it have it named that for the hotspot name..
You don't have to name your hotspot "bootmod3". You can change the WIFI settings in RPi to your phone hotspot. As long as it's in the same network it will work.
Appreciate 0
      06-28-2020, 06:20 PM   #121
codelinx
New Member
22
Rep
29
Posts

Drives: BMW X3M Comp/Pythonic Blue/BLK
Join Date: May 2020
Location: NY

iTrader: (0)

Garage List
Great tutorial and thanks for posting this. Even though Bootmod3 will be releasing the direct to phone setup in the near future I went ahead and added some stuff the original setup script did not have.

ADDS:
- systemctl service
- updated ssh
- updated wifi connection to work with your custom SSID

Sharing the systemctl service file i created.

File locations:
- working directory: /home/pi/bootmod3
- file locations:
/home/pi
.
|-- bm3_installer_v1.1.sh
|-- bootmod3
| |-- agent.jar
| |-- agentapp.jar
| |-- agentrunner.jar
| |-- bm3_systemd.log
| |-- bootmod3_service.sh



NOTES: you need a raspbian build, i used the buster install and ran this script then customized as needed. The original cron setup did not work for me so i edited the bash script to work how i wanted.

create a new file "/etc/systemd/system/bootmod3.service"
Code:
[Unit]
Description=Bootmod3
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/bootmod3
ExecStart=/bin/bash /home/pi/bootmod3/bootmod3_service.sh
ExecStop=killall java && echo $? > bm3_systemd.log 2>&1
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

When you run top on the machine the service will show up under the user "pi" and not "root"

You can access this by running "top" from your terminal then hitting "u" and enter "pi" as the user. Ctrl+c to exit top
Code:
top - 20:01:15 up 1 min,  1 user,  load average: 0.38, 0.20, 0.08
Tasks: 114 total,   1 running, 113 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.4 us,  1.2 sy,  0.0 ni, 98.4 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :    926.8 total,    699.1 free,    109.1 used,    118.6 buff/cache
MiB Swap:    100.0 total,    100.0 free,      0.0 used.    762.8 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                   
  646 pi        20   0  662536  71500  10988 S   1.3   7.5   0:18.19 java -Xmx512m -jar /home/pi/bootmod3/agent.jar                                                                                            
  831 pi        20   0    5736   2640   2108 R   0.7   0.3   0:00.23 top                                                                                                                                       
  619 pi        20   0  342460  20584  10776 S   0.3   2.2   0:01.09 java -jar agentrunner.jar                                                                                                                 
  611 pi        20   0    7676   2508   2368 S   0.0   0.3   0:00.02 /bin/bash /home/pi/bootmod3/bootmod3_service.sh                                                                                           
  626 pi        20   0   10848   3536   2908 S   0.0   0.4   0:00.07 sshd: pi@pts/0                                                                                                                            
  628 pi        20   0    3740   3120   2304 S   0.0   0.3   0:00.26 -bash

Custom Systemctl service script

NOTE: the script needs the location of "agentrunner.jar". In my file location and setup this script and the jars are in the same location.
Code:
DATE=`date '+%Y-%m-%d %H:%M:%S'`
echo "Bootmod3 Service started: ${DATE}" | systemd-cat -p info

java -jar agentrunner.jar > bm3_systemd.log 2>&1

Custom Mods:
Code:
#!/bin/bash

# Change the repo pointer
###
# CONFIRM THIS MATCHES YOUR SETUP
###
sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/raspi.list

# Make raspberry.local reachable on the network
sudo tee -a /etc/hostname > /dev/null <<EOT
127.0.1.1               raspberrypi
EOT

# Change the wifi setup
sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf > /dev/null <<EOT
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
   ssid="CUSTOM_WIFI_NAME"
   psk="CUSTOM_PASSWORD"
   key_mgmt=WPA-PSK
}
EOT

Use systemctl:
NOTE: May need to run "sudo systemctl daemon-reload" to get the service to be recognized by systemctl.

Check service is recognized
Code:
▶ sudo systemctl status bootmod3.service

# OUTPUT
* bootmod3.service - Bootmod3
   Loaded: loaded (/etc/systemd/system/bootmod3.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
NOTE: the part that says "disabled" is correct until you test and "enable" the service


Start the service and check the status of the logs
Code:
▶ sudo systemctl start bootmod3.service

#CHECK THE SERVICE
▶ systemctl status bootmod3.service

# OUTPUT
* bootmod3.service - Bootmod3
   Loaded: loaded (/etc/systemd/system/bootmod3.service; disabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-06-28 19:01:01 EDT; 1s ago
 Main PID: 8471 (bash)
    Tasks: 23 (limit: 2068)
   CGroup: /system.slice/bootmod3.service
           |-8471 /bin/bash /home/pi/bootmod3/bootmod3_service.sh
           |-8478 java -jar agentrunner.jar
           `-8487 java -Xmx512m -jar /home/pi/bootmod3/agent.jar

Jun 28 19:01:01 raspberrypi systemd[1]: Started Bootmod3.
Jun 28 19:01:01 raspberrypi cat[8474]: Bootmod3 Service started: 2020-06-28 19:01:01

Now if it all went well enable the service and restart to confirm the agentrunner is started by the new service you just created

Code:
▶ sudo systemctl enable bootmod3.service

▶ sudo systemctl status bootmod3.service

#OUTPUT

* bootmod3.service - Bootmod3
   Loaded: loaded (/etc/systemd/system/bootmod3.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
NOTE: The service should show "enabled"

SSH

Add Public ssh key

First on your laptop create an SSH Key pair
Code:
▶  ssh-keygen -t rsa -b 4096 -C "bootmod3_raspberry_pi"
##########
# Follow the prompts and make sure you change the directory path to the ssh private key 
##########
copy the ssh pub key from your laptop to your raspberry pi
Code:
▶  scp ~/.ssh/bootmod3_raspberry.pub pi@raspberry.local:/home/pi/bootmod3_raspberry.pub
##########
# Follow the prompts and make sure you change the directory path to the ssh private key 
##########

# From the raspberry pi

▶ mkdir -p ~/.ssh

▶ mv bootmod3_raspberry.pub ~/.ssh/authorized_keys

▶ chmod 600 ~/.ssh/authorized_keys

Use SSH only access setup this:
/etc/ssh/sshd_config:
Code:
#Uncomment these lines 
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys

PasswordAuthentication no

ChallengeResponseAuthentication no

UsePAM no
NOTE: Confirm in another terminal you can ssh into the box before restarting and closing or exiting your ssh session!!



Code:
▶ sudo systemctl daemon-reload

▶ systemctl status sshd

▶ sudo systemctl restart sshd
TEST Before closing your original SSH window where you logged in with a password!!
To ssh as long as you are on the same network you can ssh to
Code:
ssh -i ~/.ssh/bootmod3_raspberry pi@raspberry.local
Restart and check the logs and service!

Last edited by codelinx; 06-28-2020 at 07:03 PM.. Reason: added more content
Appreciate 0
      08-26-2020, 02:20 PM   #122
aaronbearchi
Registered
United_States
0
Rep
1
Posts

Drives: BMW M235 RWD ZF8
Join Date: Aug 2020
Location: IL

iTrader: (0)

Thank you dieselg5 for the OP with great instructions and codelinx with the recommendations for running as a service. I've got this setup and running on an underclocked RPi B+ and flashing/logging worked great on my test run this afternoon. Huge kudos to you guys.
Appreciate 0
      10-03-2020, 06:39 AM   #123
F20_Damon
Registered
0
Rep
2
Posts

Drives: BMW 116i
Join Date: Jun 2020
Location: Malaysia

iTrader: (0)

Hi,

What is the latest version of the bootmod3 agent jar files? Are those jar files downloaded via the OP's script latest version?

I have the latest mobile apps installed in my Android phone. Earlier I was attempting to update the official standard wifi firmware from PTF but due to I was unable to connect to BM3_NET and internet simultaneously, later I have decided to revert to raspberry buster lite (the method guided by OP).

Since the latest mobile apps is unable to update OBD agent anymore, I just want to ensure I have the latest version of agent jar files.

Thanks in advance for your advice!

Damon
Appreciate 0
      10-06-2020, 09:23 AM   #124
luke79
Enlisted Member
luke79's Avatar
3
Rep
40
Posts

Drives: M140i
Join Date: Sep 2019
Location: France

iTrader: (0)

Anyone found a way to ssh into the rpi with the latest firmware and weird ip ?
Appreciate 0
      10-06-2020, 01:50 PM   #125
skoold2003
Major
skoold2003's Avatar
United_States
791
Rep
1,179
Posts

Drives: 2014 X5 50i M Sport, M3(sold)
Join Date: Nov 2012
Location: PNW

iTrader: (0)

Garage List
2014 X5 50i  [7.50]
Quote:
Originally Posted by luke79 View Post
Anyone found a way to ssh into the rpi with the latest firmware and weird ip ?
It's probably IPv6.. just Google how to ssh to v6
Appreciate 0
      12-29-2020, 10:27 PM   #126
cpow99
Private
46
Rep
38
Posts

Drives: 2015 F85 / 2017 F87
Join Date: Mar 2020
Location: Austin, TX

iTrader: (1)

Garage List
2017 M2  [0.00]
2015 X5M  [0.00]
Thought of building something like this the other day and see I am late to the party. Has anyone here tried to package this up as a docker image on docker hub so that it is easier to maintain/deploy?
Appreciate 0
Post Reply

Bookmarks


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



All times are GMT -5. The time now is 04:31 AM.




f30post
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
1Addicts.com, BIMMERPOST.com, E90Post.com, F30Post.com, M3Post.com, ZPost.com, 5Post.com, 6Post.com, 7Post.com, XBimmers.com logo and trademark are properties of BIMMERPOST