Talks about how to disable serial on a dev device.
I have long wanted to be able to do this but been unable. Is there a way to enable serial support on a production device?
Usecase, I have a signed agreement saying I can’t ship devices that don’t meet a certain min security requirement. But as I start to test them in my lab, they start flicking on and offline. I want to get into the direct to see what is going on. Assuming I attach the device via ethernet and can ssh in the normal way to turn this on. Is there a way I can do that?
Can this be a feature request, for example, it could be a switch in the Device configuration?
Maybe that would be too hard, I would take hacky instructions.
I think you can do this with # systemctl start serial-getty@serial0.service
which will (temporarily, for current boot) start the getty service and should allow you to connect via serial. If you want to enable it permanently you would do the inverse of the mask in Disable console over Serial in Dev on RPi3? and instead do an enable
By setting console=ttyPS0 console=tty on cmdline.txt on a development image I am able to get a terminal with boot logs on serial UART port. i am trying to get the same on a production image but understand this is disabled (rapsberry pi 3).
Besides doing the same cmdline.txt change and enabling UART on config.txt, what else do I need to do? Do I need to enable getty as mentioned here? How do I do that for the first boot (meaning running systemctl is not an option but rather changing the balena installation image before flashing instead)
All answers I see here require to run systemctl on the device which can only be done after the device has booted the first time.
Hi there, for first boot, you can try mount the boot partition in the image you will be flashing and modify cmdline.txt to include the relevant options. That should send the boot logs to the serial interface and it’s probably enough debug your issue?
This is what I have tried so far without much luck.
In a development image I tried console=ttyAMA0 console=tty which did not work. However when I switched to console=serial1 console=tty I was able to see the boot logs on the serial (both times I had enable_uart=1 and turbo was also set to 1). I noticed that serial1 was symlinked to tttPS0
However as soon as I switched to a production image not only none of the 2 options worked and the device never shows up as a new device in the application.
I’ll give a try at ttyPS0 but at the moment I have not had much luck with it and for some reason I cannot understand the device (which has a little extra hardware such as a RTC) never shows up as a new device in the application after booting for the first time after flashing
This solution from @_Page worked for me once with a different device and OS but no longer does with Raspberry Pi 3 running balenaOS raspberrypi3-2.94.4-v12.11.36
root@c3f0bb8:/tmp# systemctl status serial-getty@serial0.service
○ serial-getty@serial0.service - Serial Getty on serial0
Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/serial-getty@.service.d
└─development-features.conf
Active: inactive (dead)
Condition: start condition failed at Mon 2022-03-14 18:54:51 UTC; 1min 3s ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
root@c3f0bb8:/tmp# systemctl start serial-getty@serial0.service
root@c3f0bb8:/tmp# systemctl status serial-getty@serial0.service
○ serial-getty@serial0.service - Serial Getty on serial0
Loaded: loaded (/lib/systemd/system/serial-getty@.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/serial-getty@.service.d
└─development-features.conf
Active: inactive (dead)
Condition: start condition failed at Mon 2022-03-14 18:56:01 UTC; 1s ago
└─ ConditionPathExists=/var/volatile/development-features was not met
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
No matter what I do I can’t seem to change the state of the serial service. I double checked config.txt
Actually even with the Development image I am having the same problem. I am using a Compute Module 3+. I rolled back to RPi 3 2.83 development and the UART serial console works fine. For me debugging internet connectivity problems is pretty important. The cell modem I am working with is not supported by ModemManager so its interface is setup in the container. Therefore any mistake in the container could cause connectivity to drop. It does seem weird that you cannot enable an offline interface to troubleshoot connectivity for a production device.
I discovered that the UART on both the dev kit and Compute Module must have been damaged when I connected the 3.3V of the serial cable to the board earlier. With a different Compute Module and Dev Kit the serial console works fine on 2.83. With the damaged CM3 with new Dev Kit or new CM3 with damaged Dev Kit, the UART is unresponsive. The 2.94 Development OS serial console probably works.
Hi, just a note that balenaOS versions above v2.85 do not have development and production image variants any more. They are a single unified release that have a developmentMode configuration option in config.json that switches between production and development mode.
The production mode is identical to the legacy production image, while the development mode is nearly identical the legacy development mode, expect that U-boot does not have IO. Instead, a custom development image can be built for OS development work.
Let us know if development/production mode works for your use case.