Comments (9)
could also be added as a testcase or in the system test
from calliopeo_astropi.
Interesting! On my freshly installed AstroPi-IR OS the login over serial port is enabled!!!!
pi@astropiir:~/src/CalliopEO_AstroPi $ cat /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=aeee2bfb-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait ipv6.disable=1
from calliopeo_astropi.
Can be closed if PR #95 is merged.
from calliopeo_astropi.
Interesting! On my freshly installed AstroPi-IR OS the login over serial port is enabled!!!!
pi@astropiir:~/src/CalliopEO_AstroPi $ cat /boot/cmdline.txt console=serial0,115200 console=tty1 root=PARTUUID=aeee2bfb-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait ipv6.disable=1
I only did the check, if the program still runs when it is disabled - so I did not checked the inital state.
I think this is a recomended hardening step and I wonder if we should really rely on this for the setup and test or just drop a alert and continue when it is enabled. Since for the calliopEO.py it does not matter if its enabled or not.
The hardening might be done on the astro pi, but not on every test system - if so we would have to write the steps in the documentation or add it to the setup.
You can follow official guide (Disable Linux serial console) to reconfigure Raspberry Pi OS here*: https://www.raspberrypi.org/documentation/configuration/uart.md
*Step (2) should be changed as below.
Otherwise, you can directly use the following steps:
- Login as root user or ssh login as pi user and then execute: sudo su root
- Start raspi-config (as root user): raspi-config
- Select option 5 - Interfacing Options
- Select option P6 - Serial
- At the prompt Would you like a login shell to be accessible over serial? answer 'No'
- At the prompt Would you like the serial port hardware to be enabled? answer 'Yes'
- Exit raspi-config and reboot the Pi for changes to take effect
- Verify that file /boot/cmdline.txt does not contain โconsole=serial0โ string
from calliopeo_astropi.
From George's mail (2021-08-19):
Some remarks regarding the serial login shell:
- You can check whether or not the serial login shell or the serial port hardware are activated or not by using (as root):
raspi-config nonint get_serial
raspi-config nonint get_serial_hwA value of 0 means the corresponding setting is activated.
- You can have the serial login shell disabled but the serial port hardware enabled by using (as root):
raspi-config nonint do_serial 2
If this works as intended then:
raspi-config nonint get_serial # should return 1, i.e. disabled raspi-config nonint get_serial_hw # should return 0, i.e. enabled
Using a value of 0 for do_serial enables both, while a value of 1 disables both.
I have already had a discussion about this with Domenico and I checked if anything obvious might be affected in Astro Pi functionality. I believe you can proceed with the setting without any issues. Besides, it is easy to set and reverse the setting using raspi-config.
from calliopeo_astropi.
The Raspberry Pi has multiple serial ports. On my test system (Raspberry Pi 3 running Astro Pi IR OS with disabled Bluetooth) with connected Calliope Mini on USB the serial ports are:
root@astropiir:~# ls -al /dev/ttyS* /dev/ttyA* /dev/serial?
lrwxrwxrwx 1 root root 7 Feb 14 2019 /dev/serial0 -> ttyAMA0
lrwxrwxrwx 1 root root 5 Feb 14 2019 /dev/serial1 -> ttyS0
crw-rw---- 1 root dialout 166, 0 Aug 22 12:14 /dev/ttyACM0
crw--w---- 1 root tty 204, 64 Feb 24 09:29 /dev/ttyAMA0
crw-rw---- 1 root dialout 4, 64 Feb 14 2019 /dev/ttyS0
/dev/serial?
are only symbolic links./dev/ttyAMA0
is the standard serial port (PL011-UART) which is accessible via the GPIO header:
/dev/ttyS0
is usually only accessible on the Raspberry Pi Compute Modules/dev/ttyACM*
(or/dev/ttyUSB*
) are serial ports which are generated when a USB-Serial transceiver is attached to the Astro Pi like the FTDI, CH340 or PL2303 chips. The Calliope Mini will always create a/dev/ttyACM*
.
From what I understand, the raspi-config
commands given by George affect /dev/serial0
, the primary serial port of the Astro Pi system. They will not affect the serial port the Calliope Mini is attached to.
My tests show, that the CalliopEO.py
scripts successfully operates regardless if the Linux console is configured on any of the serial ports /dev/serial?
.
from calliopeo_astropi.
I tried to "hack" into the Astro Pi via a serial adapter attached to USB - unsuccessfully. I used a PL2303 based USB-Serial adapter that will be listed as /dev/ttyUSB0
in Linux.
What I did:
- Attached the PL2303 USB-serial adapter to a USB port of Astro Pi
- in
/boot/cmdline.txt
I setconsole=/dev/ttyUSB0,115200
- Connected another Linux machine on the "far end" of the PL2303 USB-serial adapter
- Rebooted the Astro Pi with connected USB-serial adapter
I got no output from the boot process, no Linux console over the serial port and was not able to login.
I verified the serial connection using screen /dev/ttyUSB0 115200
on the Astro Pi and a serial terminal program on the other end of the USB-serial adapter and could establish a connection. Hence, the serial connection works.
I assume, it is not possible to activate Linux console on a serial adapter connected via USB like tested above. Google returned other necessary configuration, e.g.: https://www.tal.org/tutorials/raspberry-pi-zero-usb-serial-console
from calliopeo_astropi.
As a result, I would remove the serial port checks/settings from our setup.sh
completely. Preventing someone to gain console access over a serial port should be solely handled by the OS.
from calliopeo_astropi.
Can be closed if #97 is merged.
from calliopeo_astropi.
Related Issues (20)
- Extend testcase 1: Collect information on configuration of serial port and getty
- blkinfo 0.1.2 outdated HOT 2
- Assess impacts from AstroPi Anomaly Reports
- Link A2 and A3 in ProgramDescription (Appendices) broken
- Errors using os with gui HOT 4
- update 30sec-iss-sensors HOT 2
- Readme: note that zip has to be unziped on pi and not before uploading
- SCD30 calibration HOT 2
- setup.sh: Set permissions of /home/calliope to 700 HOT 4
- setup.sh: argparse wheel necessary? HOT 2
- setup.sh: Avoid installation for user pi HOT 2
- README/ProgramDescription: Adapt completely to AstroPi OS HOT 1
- ProgramDescription: Adapt the description to log-in via SSH HOT 1
- setup.sh: Check for necessary programs like pip, ... HOT 2
- Add to testcase 01: Check if necessary programs exist HOT 1
- Provide HEX file(s) for initial scientific measurements HOT 3
- README: Correct syntax, remove python3
- Release version 1.2.0 HOT 1
- Setup: check requirements before installation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calliopeo_astropi.