DISCUSSION

[GUIDE] How to use Mobro app on normal Raspberry PI OS in desktop mode (without mobro custom OS image)

9 people are following

Hello,

I absolutely love mobro app. You install mobro custom raspberry OS image and you are good to go. Awesome, but what if you wanted to use your Raspberry PI for other things, not just monitoring PC stats? Well now you can.

My setup:

Raspberry PI 3 Model B Rev 1.2 with 7 inch touchscreen for Raspberry Pi.

Install and run mobro application on your Windows machine you wish to monitor

Install Raspberry PI OS (32 bit) to your SD card using Raspberry Imagizer (skip if you already have OS installed)

  1. Boot up your Raspebbery PI and follow steps
  2. Connect Raspberry PI to your WiFi
  3. Go to your /home/user folder (my user is called ‘pi’ so I go to /home/pi) and make directory ‘mobros’ (I'll reference this folder as /home/pi/mobros from now on)
  4. Download mobros-raspberrypi from github: https://github.com/ModBros/mobro-raspberrypi
  5. Extract the project to /home/pi/mobros so you have directory /home/pi/mobros/mobro-raspberrypi-master/
  6. Now we will change several files in project we extracted:
    1. Go to services folder inside mobro-rasperrypi-master:
      1. Open mobro.service in text editor
      2. Change WorkingDirectory path to: /home/pi/mobros/mobro-raspberrypi-master/scripts
      3. Change ExecStart path to: /home/pi/mobros/mobro-raspberrypi-master/service/mobro.sh
      4. Change User=mobros to User=pi (or your username, mine is pi)
      5. Save
    2. Inside services folder open mobro.sh in text editor:
      1. Change path of LOG_DIR to match our folder we extracted to: /home/pi/mobros/mobro-raspberrypi-master/log
      2. Do the same for RESOURCES_DIR: /home/pi/mobros/mobro-raspberrypi-master/resources
      3. Do the same for DATA_DIR: /home/pi/mobros/mobro-raspberrypi-master/data
      4. Find in file the word: --kiosk and delete that line (kiosk mode launches browser in full screen mode and disables you to get to desktop, we don't want that!) EDIT: If you want full screen at start-up instead of --kiosk use --start-fullscreen (This way you can exit fullscreen, you won't be locked out)
    3. Inside scripts folder open apply_new_config.sh in text editor:
      1. As in previous step change LOG_DIR and CONF_DIR to match our folder path
    4. Inside web folder open constants.php in text editor:
      1. Change HOME_DIR path to /home/pi/mobros
      2. Change BASE_PATH path to /home/pi/mobros/mobro-raspberrypi-master
    5. Now we will follow some of the steps in mobro's install.sh script:
      1. Open terminal; sudo su
      2. cd /home/pi/mobros/mobro-raspberrypi-master
      3. Do these commands (pay attention to your paths - I use /home/pi/mobros…):
Replies 1 - 17 (17)

chmod 755 ./scripts/*.sh

chmod 755 ./service/mobro.sh

chmod 644 ./service/mobro.service

chmod 666 ./data/*

chmod 666 ./log/*

chmod 666 ./config/*

chmod 444 ./resources/*

apt-get update

apt-get upgrade -y

apt-get update

 

while read dep; do

   echo -n "Installing $dep..."

   apt-get -y install "$dep" >/dev/null

   echo " done"

done <"./dependencies.txt"

 

rm -rf /var/www/*

ln -s /home/pi/mobros/mobro-raspberrypi-master/web /var/www/html

sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=1/g" /etc/php/7.3/fpm/php.ini

cat ./config/15-fastcgi-php.conf >/etc/lighttpd/conf-available/15-fastcgi-php.conf

lighttpd-enable-mod fastcgi

lighttpd-enable-mod fastcgi-php

service lighttpd force-reload

service lighttpd restart

systemctl enable lighttpd.service

 

cat ./config/hostname >/etc/hostname

cat ./config/hosts >/etc/hosts

 

git clone https://github.com/goodtft/LCD-show.git /home/pi/mobros/display-drivers/GoodTFT

git clone https://github.com/waveshare/LCD-show.git /home/pi/mobros/display-drivers/Waveshare

chmod +x /home/pi/mobros/display-drivers/GoodTFT/*show

chmod +x /home/pi/mobros/display-drivers/Waveshare/*show

 

rm -rf create_ap

git clone https://github.com/oblique/create_ap

chmod -R 755 create_ap

cd create_ap || exit

make install

cd ..

 

apt-get autoremove --purge -y

apt-get autoclean -y

apt-get clean -y

 

ln -s /home/pi/mobros/mobro-raspberrypi-master/service/mobro.service /lib/systemd/system/mobro.service

systemctl daemon-reload

systemctl enable mobro.service

systemctl stop mobro.service

reboot

 

After reboot if everything was done correctly after a few moments monitoring app will launch in Raspberry Pi browser and just hit F11 to go full screen. Exit fullscreen and use your Raspberry PI for anything else.

You may need to configure monitoring app in raspberry pi by launching browser and going to this address:  http://localhost

There you will find Mobro configuration wizard, just follow the steps.

Let me know if you succeeded or need help :)

I was also looking to use the pi and display for more then MoBro and was looking for docs on installing it standalone. Thanks for posting this information. 

Thanks for putting this together in such detail @Strider  :)

If you just want to display the stats screen on your Raspberry Pi and don't necessarily need the full application (like the whole hot-spot/configuration part etc.) you could also go the easier route like we described here: https://www.mod-bros.com/en/faq/mobro/raspberry/diy-setup
That's a way simpler setup and you basically don't have to install anything. You have to know your PCs IP address though.

Just as a hint in case you guys didn't know yet

Oh, did not see that line of documentation since the focus and start of the article is all on flashing and installing the pre made image and I did not bother reading it. ;)

 

Thanks.

Seraksab

Thanks for putting this together in such detail @Strider  :)

If you just want to display the stats screen on your Raspberry Pi and don't necessarily need the full application (like the whole hot-spot/configuration part etc.) you could also go the easier route like we described here: https://www.mod-bros.com/en/faq/mobro/raspberry/diy-setup
That's a way simpler setup and you basically don't have to install anything. You have to know your PCs IP address though.

Just as a hint in case you guys didn't know yet

Aw, I missed that info. I went hardcore and checked out how this works file by file :D I learned some new things about linux services and scripts though. Still, I'm pretty happy how this works, everything is still automated. RaspberryPI will check occasionally if mobro app is running on windows machine if not launches the clock screensaver (whoever thought of this feature is a genius).

Yeah I guess just going through the code and reverse engineering stuff is definitely also an option :P
But hey, that's why we put it up on GitHub anyway

Well the screensaver feature was actually something that was suggested by a lot you guys in the forum and on Discord. We then just went with the idea and actually implemented it. 
So we can't really take all of that “genius” praise for ourselves. But I guess at least some of it, so thanks ;)

Thank You @Strider for the work to write this tutorial.
I'm building a quite heavy modded Deepcool Quadstellar build with two displays in the lower sections of the case. With the install on the normal raspberry Pi OS im now able do use both HDMI ports of the Pi 4 to clone the ModBros display to both outputs.

The only small annoyance was, that the configuration with http://localhost did not work, the browser could not resolve the address. But the application works fine as long as the network name of the desktop application stays at the default setting.

And so starts the long wait till cpu and graphicscard will be available to finish the build….

Hello,

I'm actually trying to optimize my Raspberry pi Zero W by installing DietPi OS, but I can't get the mobros service to work.

The following function isn't working but the other are.

Do you guys have any clue?

Regards.

“The following function isn't working but the other are.” 
What exactly do you mean by that?

Also i doubt you will be able to optimize that much by using DietPi OS. Our image is already based on Raspberry OS Light with only the necessary additional packages installed. So it's already pretty minimal.
I mean you would surely be able to shave off a few more things if you really wanted to but what's really slowing the Pi Zero down is starting chromium and opening the theme. And that's something that i guess won't be any faster on DietPi.

Nevertheless if you manage to get it to run I would be interested to know if it made any difference ;)

Sorry, I forgot to write the cmd line which is bothering me:

ln -s /home/pi/mobros/mobro-raspberrypi-master/service/mobro.service /lib/systemd/system/mobro.service

I can't figure out why it is not working despite having the good path.
 

With your image, my raspberry pi zero W looks like it can't keep up the data flow rate… I.E. if I stop mobros service in my pc the rspi zero w will continue showing data for like 30 sec before disconnecting..

I'm still digging to understand how does the service works on a raspberry pi. Not totally familiar with it yet ;)

Hi folks. I tried flashing the image to the card of my Raspberry 3 Model B and it wasn't recognizing my USB wifi dongle (I assume)

So I connected it directly to the router and it gets to the point where it is looking for my PC but sat there for about an hour and a half with no results.

Tried the browser method. It didn't get me anywhere.

Then I tried the above method. Everything seemed to go fine but after the reboot, I get a No Session for PID error on boot. It goes to Creating wireless hotspot and the reboots. Rinse and repeat.

Any help from you more experienced folks would be great. I've been at it for over 8 hours now and I've basically given up.

Hi @SOS 

The Raspberry Pi 3 does support Wifi already on its own. So you shouldn't need a USB wifi dongle.
I haven't tested this scenario yet so there might be some issues when you're using multiple wifi interfaces at the same time.

Also what exactly doesn't work when you try the browser method?
Because if you're not able to connect using a browser, our image also won't be able to do so.

 

@Racoon 

sorry for the late response, but could you post me the error you get when executing that command?
otherwise it's a bit hard for me to see what's going wrong there ;)

Thanks for the guide!

Went with the diy mode with a script that runs chromium in kioskmode on boot. MoBro is a great software, Ill  buy u guys another beer I think ;) 

Strider fantastic guide. I was able to get this working on a pi 4.

That said I have one small hiccup. The chromium browser starts, the stats are displayed, then chrome closes and restarts. Where in the configs should I look to disable the restart? 

Hi @Strider @Seraksab, trying to set this up but it seems php7.3-fpm isn't available anymore. I tried installing 7.4 and modified the command (sed) or files (both 15-fastcgi-php.conf files to change the path in the code) in these steps to account for the different version:

sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=1/g" /etc/php/7.3/fpm/php.ini

cat ./config/15-fastcgi-php.conf >/etc/lighttpd/conf-available/15-fastcgi-php.conf

Anyway I got all the way to the localhost wizard, and after answering all the questions and clicking apply it takes me to localhost/mobro/save.php and only shows a white screen that never progresses, and a reboot does nothing but boot normally. Any tips or suggestions for troubleshooting? 

I was able to connect with the browser method but I would like the screensaver and full screen on boot features of the full install etc.

 

Edit: Got it to boot to mobros, but now it gets to the ‘creating wireless hotspot’ screen and then bootloops.

 

captngalaxy

Hi @Strider @Seraksab, trying to set this up but it seems php7.3-fpm isn't available anymore. I tried installing 7.4 and modified the command (sed) or files (both 15-fastcgi-php.conf files to change the path in the code) in these steps to account for the different version:

sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=1/g" /etc/php/7.3/fpm/php.ini

cat ./config/15-fastcgi-php.conf >/etc/lighttpd/conf-available/15-fastcgi-php.conf

Anyway I got all the way to the localhost wizard, and after answering all the questions and clicking apply it takes me to localhost/mobro/save.php and only shows a white screen that never progresses, and a reboot does nothing but boot normally. Any tips or suggestions for troubleshooting? 

I was able to connect with the browser method but I would like the screensaver and full screen on boot features of the full install etc.

 

Edit: Got it to boot to mobros, but now it gets to the ‘creating wireless hotspot’ screen and then bootloops.

 

I'm getting the same issue as in the edit.  The raspberrypi boots, goes to creating wireless hotspot screen and then bootloops. Any fix?

Login to comment

Login
Like most websites, we also use cookies. But don't worry, we only use them for your login and statistics.