MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MM on a Raspberry Zero W in 2023

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 2 Posters 2.0k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      MerlinElMago
      last edited by

      Hello everybody,
      I just set up my MM software on a Raspberry Pi Zero W. You might ask why such an old device in 2023… well there are several reasons for that:
      1st I just had some laying around from past projects and 2nd ( and most important ) the low power draw of the Zero W was just perfect to power it off a USB connection on my monitor, so I did not have to fiddle around with buck converters to power the pi.

      I ran into several problems while installing it, and I just want to share the solutions I found for them.

      ¿RaspberryOS light or full?
      Well, the easiest way is to opt for a full flegded OS, but since the Zero W has so limited capability, I opted for a Light install. So I had to adapt my installation mixing several ( outdated ) installation tutorials I found. In the end, I installed Xorg and openbox manually and start them from my .profile with autologin. After that, I start the browser from whithin my /etc/xdg/openbox/autostart

      Which lightweight browser can I use on the Zero W?
      The quick and easy answer is none. Chromium is not supported anymore on the Zero W ( legacy build is an option though, but segfaults frequently due to the limited amount of ram ); Midory works ok, but I was not able to remove the direction bar from the top, so that did not work either. So in the end, I opted to write a simple “browser” myself with Python Webkit2 bindings. I had to install de following software:
      sudo apt-get install gir1.2-webkit2-4.0 libgtk-3-dev libwebkit2gtk-4.0-dev python3-gi

      After that, the following file did the trick:

      import gi
      gi.require_version("Gtk", "3.0")
      gi.require_version("WebKit2", "4.0")
      from gi.repository import Gtk, WebKit2
      
      class Minibrowser(Gtk.Window):
          def __init__(self):
              Gtk.Window.__init__(self, title="MagicMirror²")
             # The size doesn't actually matter since on the bottom we are going to maximize the window
              self.set_default_size(800, 600)
      
              web_view = WebKit2.WebView()
              web_view.load_uri("http://localhost:8080")
      
              scrolled_window = Gtk.ScrolledWindow()
              scrolled_window.add(web_view)
              self.add(scrolled_window)
              self.fullscreen()
      
      if __name__ == "__main__":
          win = Minibrowser()
          win.connect("destroy", Gtk.main_quit)
          win.show_all()
          Gtk.main()
      

      ¡The boot process is ugly!
      Yes it is and I installed plymouth to make it more attractive. In the end it doen’t actually matter and it even delays de boot for a few seconds, but I like it!
      I installed the plymouth spinfinity theme and made it all black. After that I added splash quiet to the /boot/cmdline.txt file and that was it.

      I hope that this helps a few fellow tinkerers who wish to repurpose their old Zeros.

      Best regards
      Merlin

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @MerlinElMago
        last edited by

        @MerlinElMago if you use my install script, it will setup pi0w to run successfully w chromium, Firefox or Midori.

        you do have to increase the swap space

        see
        https://github.com/sdetweil/MagicMirror_scripts

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          MerlinElMago @sdetweil
          last edited by

          @sdetweil Thanks for the tip. Will try it, but I’m reasonably happy with my minibrowser because it is not as resource hungry as ff or chromium.

          Looking at your script I see you pass -e Fullscreen -e Navigationbar to the Midori browser, but with those arguments, the address bar would still appear…

          Best regards
          Merlin

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @MerlinElMago
            last edited by

            @MerlinElMago as I said, those parms to Midori work properly for me

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy