Difference between revisions of "Installation"

From bcmeter.org
Jump to navigation Jump to search
Line 6: Line 6:
3. Eject the microSD card and put it into the raspberry pi and boot it up. After 1-2 Minutes it should be logged into the WiFi with hostname bcMeter or bcMeter.local
3. Eject the microSD card and put it into the raspberry pi and boot it up. After 1-2 Minutes it should be logged into the WiFi with hostname bcMeter or bcMeter.local


== Alternative: Manual Set Up the microSD Card ==
== Advanced: Manual headless Set Up the microSD Card ==
'''Only continue if you really need and want to setup the system manually!
'''=== Download Image ===


=== Download Image ===
Use the [https://www.raspberrypi.com/software/ Raspberry Imager] tool to write Raspberry OS LITE (very important - not Desktop!) to your card. Configure the tool to work with username pi and choose any password.<br><br>
[https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit Raspberry Pi OS '''Lite'''] and use [https://www.balena.io/etcher/ Etcher] to copy it to your microSD card <br><br>
Enable SSH and WiFi in the tool.
'''Make sure to download the Lite''' image and '''not''' Desktop / Desktop and recommended software!


=== Configure Raspberry OS ===
After finishing, eject the microSD Card from the PC and put it into the Raspberry Pi.


With the image copied over to the microSD-Card, Windows and OSX now see a new drive/partition named '''„boot“ visible in Explorer or Finder.'''
<br>On Linux you see additionally rootfs, we can ignore this. 
=== Enable SSH Access ===
'''On Windows,''' open Notepad and create a new an empty file just called „ssh“ on the new boot partition. <br>
'''On OSX''', open the text editor and save the file just as "ssh" to the new boot partition.
<br><br>
Alternatively, you can simply do that in Linux/OSX in terminal by navigating to the /boot partition of the microSD Card and enter
      touch ssh
=== Enable WiFi access ===
After the image is written to the microSD-Card, a new drive is visible in Windows Explorer or Mac OS Finder called /boot.
Create a file wpa_supplicant.conf with the details below, editing in your WiFi credentials, and save it directly on /boot.
<br>
'''[https://bcmeter.org/download/wpa_supplicant.conf Download sample wpa_supplicant.conf] for editing. Copy it directly to /boot.'''
<br>
This file contains the credentials needed to connect to your WiFi. Add as many Networks as you like.
<br><br>'''In OSX Text Editor we need to press SHIFT+COMMAND+T first. This enables the plain text mode which is needed and stripes all formattings etc. ''' But using terminal / nano here is again a good idea.
<br>
'''Be sure to edit the parameter „country“ correctly, else the pi may not be able to connect to your WiFi.'''
Copy / paste the following. Make sure quotes are pasted correctly.
      ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
      country=de
      update_config=1
     
     
      network={
      ssid="YourWiFiName"
      psk="Password"
      }
Save the file and eject the microSD Card from the PC. This file will be removed from this place as soon as the raspberry has read it. If your Raspberry does not connect to your WiFi, you can repeat this process as often as necessary. If the file is still there after an attempted boot, there has something more severe gone wrong.


=== Configuring the Raspberry Pi to be a bcMeter via SSH remote access and WiFi ===
=== Configuring the Raspberry Pi to be a bcMeter via SSH remote access and WiFi ===

Revision as of 16:48, 21 April 2022

Recommended: Use of preconfigured microSD Card image

1. Download the file image here, unzip it and use Etcher to copy it to your microSD card.
2. After the process is complete, a new drive is visible in Windows Explorer or Mac OS Finder called /boot. Here you find wpa_supplicant.conf - open that file with any notepad application and change the WiFi credentials to your needs. Dont use Word or Office since they might change the quotation marks. Enable plain text mode in OSX Text Edit (SHIFT+COMMAND+T).
If it is refused to save the wpa_supplicant directly by the text editor, copy the file over to your PC, edit it there and copy back. 3. Eject the microSD card and put it into the raspberry pi and boot it up. After 1-2 Minutes it should be logged into the WiFi with hostname bcMeter or bcMeter.local

Advanced: Manual headless Set Up the microSD Card

Only continue if you really need and want to setup the system manually! === Download Image ===

Use the Raspberry Imager tool to write Raspberry OS LITE (very important - not Desktop!) to your card. Configure the tool to work with username pi and choose any password.

Enable SSH and WiFi in the tool.

After finishing, eject the microSD Card from the PC and put it into the Raspberry Pi.


Configuring the Raspberry Pi to be a bcMeter via SSH remote access and WiFi

Put microSD-Card in Raspberry and boot it up (takes up to a minute)

Log into the raspberry via terminal on Linux/OSX

     ssh pi@raspberrypi 

or alternatively if connection is refused

     ssh pi@raspberrypi.local


Or any terminal client on Windows (for example Putty) with the following default credentials

address: raspberrypi

login name: pi

login passwort: raspberry

(For some mobile hotspots it is required to add .local to the hostname (e.g. raspberryp.local). Try this first if no connection is possible.)

5. Being logged in, enter

      wget -N https://raw.githubusercontent.com/bcmeter/bcmeter/main/install.sh && sudo bash install.sh