Auto login on BeagleBone White + Angstrom 3.2 - autologin

I'd like to find a way to make my BeagleBone (white) Rev A6a autologin after being powered up. I'm using Angstrom with kernel 3.2.34, which uses systemd instead of innitab.
I've already seen some topics (like this question) with reference to modifications on some service files (like /etc/systemd/system/getty.target.wants/getty#tty1.service), but that only helped me partly: If I power/reset my BBone while keeping it connected via USB to my computer, it autologs as expected. But, if I just power the BBone with a wallwart (without any other connections), it doesn't seem to log in. At least I believe that's what is happening, as I have a program prepared to autorun after login and it only starts on the first case (with USB on).
I'd appreciate any help. Thanks.

Turned out that a RF module attached to my beaglebone was being powered via USB, and this module should be activated by my test program mentioned in the question. So, when I unplugged my BBone USB cable, I was actually separating its GND from the RF Module's ground.
In short, I just had to use the same source in the entire circuit and keep the autologin configuration explained in the topic I also mentioned in my question.

You could make your program a service and run after user instance of systemd.
Lets say you have a graphical.target in your /usr/lib/systemd/system then just put symlink to ../systemd-user#.target to /usr/lib/systemd/system/graphical.target.wants/system named like systemd-user#<your-user-name>.service.
This systemd-user#.service should containe ExecStart line like /usr/bin/systemd --user.
Then you'll have to add your application's service-file to /usr/lib/systemd/user.
More info is at http://www.freedesktop.org/software/systemd/man/systemd.html and http://www.freedesktop.org/software/systemd/man/systemd.unit.html

Related

How to add splash screen on custom linux(specially raspberry pi)

I currently have a project so basically what i want is to create an embedded linux in raspberry pi. What i want to achieve is to boot my custom made linux in my raspberry pi. I'm currently using Buildroot for that.
Here are the things what i want to happen:
Create a splash screen(How to implement this? What are the files on linux needed to edit. )
Override login prompt after booting(I want to use my own prompt which is i already created using python. What i want here is after booting my python app will be the first one to display)
Display my python application after booting.
WHAT files/configurations i need to know.
HOW to implement this. Process or a work flow.
Just like osmc or kido but i want to build my own also from scratch. Any help will be appreciated.
There are multiple components involved in splash screen. One is what you can display when u-boot starts and then the kernel takes over. You can get some information here and here. Both require re compilation of u-boot and Linux kernel. May be even some more additional steps depending on system. Also note this transition is not going to be smooth, between the logo displayed by u-boot and then the kernel.
On desktops, this is generally taken care of by software like Plymouth.
From what I understand, you want your python application to auto start after booting. Have a look at writing a systemd service for that as described here.

Run script on Linux startup as late as possible

I created a simple module that controls wheter a USB supplies power for a device when in host mode or not. When loaded, this module cuts off the power to any device connected until told otherwise.
It is also desired that when booted, the system comes with both my module loaded, and the USB supply cut off. To this end, so far I've tried:
Setting my module as a kernel built-in: had no effect, modules that are loaded later overrun my configuration;
Creating an init.d script: Created the script, and set it up to run on rc5. No luck as well, I run into multiple problems with USB devices (such as usb 2-1: device descriptor read/64, error -110);
I'm running Kernel 3.12 on a custom board, and I've tested that the module works as intended if I load it manually (via modprobe) into the system, after logging in.
Ideally, I want to keep these configurations to be done during boot, without any need of logins and such.
So, my question is: how can I postpone the module loading until the last possible minute, assuring that any other configuration is already finished? Also, is udev a good solution for this sort of thing? From what I read, I had the impression it wouldn't be the best fit...
Regards,
Guilherme
So, I've figured out how to get rid of the errors when using an init.d script. All that is needed is to unbind the devices before loading the module. the following line before the modprobe did the trick for me:
echo "2-1" > /sys/bus/usb/drivers/usb/unbind
Regards,
Guilherme

Using 7" TouchScreen Cape on Beaglebone Black

So, im developing an robotics application that uses a BeagleboneBlack as a controller for 3 different servos.
I know how to access the pins and everything from Cloud9 IDE directly into the board.
However, im using a 7" cape ( 4d Systems, 4DCAPE-70T ) and when i connect them, Debian automatically starts up.
I guess my question is, how do you code an app with a UI that can be accessed from the Debian distro directly from the 7" screen?
All my research has lead me to a final decision, which is mounting a node.js server on the bbb and making an HTML interface and with the bonescript libs, access the pins.
Has anybody done anything similar to this?
If anybody has a another approach to this, that would be great
If any time traveller out there stumbles upon this question, here is how i figured it out:
1) Get rid of bonescript. It will give you a hard time assigning pins for PWM and some other uses. Instead, use octalbonescript. reference to repo
2) Install socket.io
try and start a local server with it. Follow various tutos out there. If you run into a boot-up error regarding the server, use port 8090.
3) Design a web page that connects to a local host ( beaglebone itself) using socket.io. Again, various tutos out there.
DONT TOUCH THE KERNEL, NOR THE FILE TREE. Its unnecesary.
4) Open that same web page on your beaglebone. That way, you dont need an internet connection or whatever. The javascript side of the web page will call the appropriate methods on the beaglebone through socket.io ( socket.emit() ).
Its important to understand that all the beaglebone-side instructions, such as pin access, pwm and such, are performed on the same file where the socket is made. The web page 'calls' this methods on the bbb.
5) Enjoy!
I was using it for a robotics project. We were building a delta robot controlled by the Beaglebone Black ( Rev C ). I am serious, start with what i am telling you, you will save a LOT of time.
Edit: Guess i forgot the most important part. The cape uses several of the pins, incluiding various PWM. Octalbonescript, as of this moment, does not support capes. It will, but not at the moment. So, dump the screen and use an ethernet cable to connect your beaglebone to the network. That way, you can access the interface from any device through a browser at beaglebone:8090. ( NOT beaglebone.local:8090 )

Bluetooth for ARM embedded linux

I'm struggling now for a few days to setup bluetooth services on an ARM embedded device running Linux. I'm using a bluetooth dongle connected via USB.
Let's start with the beginning. I had to compile myself all the required packages, and that means expat, dbus, zlib, libffi, glib, bluez-3.36-libs and bluez-3.36-utils (yeah 3.36, I know they're old but so is my cross-compiler), libopenobex-1.3, obexd-0.3, obexftp. Then I put the binaries and libs on the device. Also, bluetooth is enabled in kernel.
I'm able to activate the bluetooth using hciconfig hci0 up command, I can perform scan using hcitool scan, I can even ping with l2ping previously discovered devices.
What I want is to be able to transfer files between that ARM device and another bluetooth device using ftp protocol and here my problems begin.
Are these the only tools that I need?
After putting everything on the device, I turn on bluetooth using hciconfig hci0 up, then I start dbus daemon using dbus-launch and after these I try to start obexd. When I run dbus-launch, it prints the values for DBUS_SESSION_BUS_ADDRESS and some pid and next when I try to start obexd it asks me to set the DBUS_SESSION_BUS_ADDRESS. Is this normal because I read that you have to set this only for test purposes? What is the default (real) dbus session bus address? How should I properly configure dbus?
I tend to think that the problem is in the pairing process, when the two bluetooth devices are trying to authenticate. How can I do this from command line as this is all that I have (no GUI)?
Could you please present me the detailed step to follow in order to achieve my goal. I tried to learn more about them from the Internet and also I tried to find these steps online but I could not find what I need.
Could you please explain me the difference between obexd, obexd-client, obexd-server, obex-data-server, obexftp? Are they meant to be used together or they offer the same functionalities? I could not clarify this from their man pages.
I know this is a really long post with a lot of questions, but I don't have experience with bluetooth and I'm under time pressure to solve this. Any help would be kindly appreciated.
Many questions you raised, but will try to answer them :
Thatz pretty much everything you will need.
Why are you starting session bus ? Will not starting system bus help and hcid uses system bus( as far as i know ). You need to execute the cross-compiled obexd ( or any other utility) with correct parameters.
you can use simple-agent ( it is in tools dir in 3.36 release if i am not wrong ). In a non-gui mode ( simple-agent --default [ follower by your pincode ] ) will work.
Basically you will need to find a device ( do scan ), authenticate ( pair ) and then proceed with file transfer which will involve obex level request / response ( to put in simple words).
As much i know, initially obexftp / obex-push were the only standalone utilities that worked on top of openobex for file transfer. Obex-data-serer was developed as part of GSOC competition, which got included in major distros. obexd is the slimmer version of obex-data-server specifically designed for embedded usage and is closely integrated with hcid ( and bluetoothd later). Please use only one of the utilities and not all at same time.

Problems installation of camera drivers - linux

I want to install the drivers of the video camera on my linux computer.
I write the command:
modprobe usbserial vendor=... product=...
what I expected to get was ttyUSB0 (or sth simmilar) in the /dev directory.
Instead what is getting installed is sg3 (whatever that is) and when I run a program that is supposed to send a command to start recording I get no results (but no errors either).
(I changed what I had previously: fd = open(/dev/ttyUSB0,...) to /dev/sg3 but I guess this is not a configuration that enables sending this kind of data.
What might be the problem? (Sorry if it's a basic question)
cameras and linux can be tricky.
Start by plugging in the camera and running
lsusb
google for the id to see if anyone has a step by step tutorial or at very least can tell you which modules are needed.
Most common drivers seem to have been migrated to the kernel, so rebulid your kernel make sure the modules are built.
Some more obscure usb modules have to be built by hand.

Resources