Headless Tinkerboard - Connect to Wifi on boot - wifi

I have installed Linux tinkerboard 4.4.103+ on my TinkerBoard. For security reasons, I have disabled lightdm, created a new user and enabled login upon boot. I have configured the wifi by providing the credentials, by enabling lightdm and disabled it again. Now whenever I boot TinkerBoard, it will boot on command line mode and will request for the login and password.
I have got programs that runs on reboot, for which I have set a cron. When I boot the tinkerboard, all the programs that should run on boot, runs, without logging into the system. However, I could connect to the wifi `only if I login and not otherwise.
I do not have much idea about how to set the wifi. I went through various blogs and web pages related to this and compared it with setting up the wifi for Rpi as well. I followed the instructions given here in TinkerBoard forum. I did the following :
sudo apt-get wpasupplicant
wpa_passphrase SSID Password
Copied the output to
/etc/wpa_supplicant/wpa_supplicant.conf
ip link show wlan0
got the following output
wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether f0:03:8c:63:0c:bd brd ff:ff:ff:ff:ff:ff
sudo /sbin/iw wlan0 scan
The above command shows that the tinkerboard is connected to wlan0.
sudo wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
The above command gave me the following output:
Successfully initialised wpa_supplicant
Failed to open config file '/etc/wpa_supplicant.conf', error: No such file or directory.
Failed to read or parse configuration '/etc/wpa_supplicant.conf'.
Since the error was No file, I changed the path fo copy in the above command as follows
sudo wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
This gave me the following output:
Successfully initialised spa_supplicant
ioctl(SIOCSIWAP): Operation not permitted
ioctl(SIOCSIWENDODEEXT): Invalid argument
ioctl(SIOCSIWENCODEEXT): Invalid argument
I ran all the codes as root only. The problem that I am facing is, the tinkerboard is not connecting to internet on boot, but does so only when I login using loginid and password.
Since the tinker boards are installed at client's location the requirement for login id and password becomes mandatory. Besides the programs should run on powering on the device. And to reiterate, my other bash scripts are running with no trouble even without logging into the system. However, the tinkerboard connects to internet only when I login into the system. How do I connect to wifi upon booting the tinkerboard.

None of the suggestions given online worked. I have retained the NetworkManager.service. Logged in, into the system and selected the wifi from the Start --> preferences --> Network Connections. Changed the setting to include all the users of tinkerboard which resolved the issue.

Related

unable to connect google coral using OTG port

When I'm running google coral using serial port I'm able to run demo apps but when I'm trying to run
google coral using data port (type c cable) I'm unable to connect with a dev board
rahul#ubuntu:~$ mdt shell
Waiting for a device...
Connecting to wishful-yarn at 192.168.101.2
Key not present on wishful-yarn -- pushing
It looks like you're trying to connect to a device that isn't connected
to your workstation via USB and doesn't have the SSH key this MDT generated.
To connect with MDT shell you will need to first connect to your device
ONLY via USB.
The problem is caused by the PyPI package mendel-development-tool itself. This error is raised by the 'NonLocalDeviceError' exception as can be seen in line 83 of command.py in the code of the package. Whenever the IP of the device does not start with 192.168.100, this exception is raised by sshclient.py (in line 86). This worked for the last Release of Mendel Linux (chef), since the IP address of the usbnet connection was 192.168.100.2. In my case the new Release of Mendel (day), which came lately in November 2019 had the IP 192.168.101.2. To check the IP check the output of
mdt devices
If you installed the package using pip3 as user, like it is recommended by the documentation (pip3 install --user mendel-development-tool), this can be fixed by a quick local patch:
Open the file in your favourite text editor
vim $HOME/.local/lib/python3.6/site-packages/mdt/sshclient.py +86
Replace line 86, which is
if not self.address.startswith('192.168.100'):
raise NonLocalDeviceError()
by the following code
if not self.address.startswith('192.168.10'):
raise NonLocalDeviceError()
Most likely the authors might update the PyPI package to this solution, since the master branch of command.py already has the proposed code. Once the package has been updated you just have to update it on your host.
pip3 install --upgrade mendel-development-tool
The issue is google coral dev is connecting to WIFI also.
First you need to delete the wifi in google coral using nmtui --> edit connection --> delete.
Then connect your host computer to google coral dev board through USB C OTG data cable.
Through serial console to devboard, delete the contents of the /home/mendel/.ssh/authorized_keys
reset the mdt service in google coral devboard using mdt-keymaster
sudo service mdt-keymaster restart
Delete the mdt key in your host computer through rm ~/.config/mdt/keys/mdt.key
Correct the IP issue in NonLocalDeviceError as above
Then try mdt shell
if nothing working, reflash the coral board by using below procedure
Connect your dev board via serial cable and login [Ist terminal].
Once login hit sudo reboot-bootloader to put devboard in fastboot mode.
Open 2nd terminal and perform below steps to flash mendel linux
cd $HOME/Downloads
curl -O https://dl.google.com/coral/mendel/enterprise/mendel-enterprise-chef-13.zip
unzip mendel-enterprise-chef-13
cd mendel-enterprise-chef-13
bash flash.sh
Once Flashing the board complete shutdown google coral sudo shutdown now
Connect devboard again, then follow the previous steps 1-5 again.

Is there a way to connect through remote desktop to a running Windows Server container?

I want to run an old .NET application in a docker windows server container (https://hub.docker.com/r/microsoft/windowsservercore/).
Everything would be easy if this application didn't require an UI. Its UI does a lot of stuff and this stuff cannot be done through command line or other API.
Basically, the perfect thing would be to reach this running container through RDP.
From my understanding, it is nothing more than a service (TermService) running on a certain TCP port (3389 being the default one).
But it seems that TermService is not running in microsoft/windowsservercore containers.
I found an article showing how to activate it : https://withinrafael.com/2018/03/09/using-remote-desktop-services-in-containers/
Basically, I kept the same Dockerfile, just changing some credentials.
#escape=`
FROM microsoft/windowsservercore:1709_KB4074588
RUN net user /add jerome
RUN net user jerome aDifficultPassword
RUN net localgroup "Remote Desktop Users" jerome /add
RUN net localgroup "Administrators" jerome /add
RUN cmd /k reg add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v TemporaryALiC /t REG_DWORD /d 1
I launch the container with this command :
docker run -it -p3389:3389 myimage powershell
When I connect to the container and type some powershell commands to list running services, I can see that TermService is well running. This is the command I use to list services.
Get-Service
When I list opened TCP ports, I can see that 3389 is listened. This is the command I use to show opened ports.
netstat -an
When I try to connect to the container through my remote desktop client, things seems OK at start.
It asks me for host.
Then for a username and password.
If I type wrong credentials, it says me "Wrong credentials", so there is well a communication with the server.
If I type good credentials, nothing happens. No error message at all, but no display screen too...
I don't really know if logs are generated somewhere or not.
I would be OK if instead of RDS, something like TigerVNC was working. I have never tried this tool before but it seems that it could do the job.
How would you do to control a GUI application running in a windows container?
You can find logs for RDP client in event viewer : "Application and Services Logs"\Microsoft\Windows\TerminalServices-ClientActiveXCore. Here's what is says for me :
The client has established a multi-transport connection to the server.
RDPClient_SSL: An error was encountered when transitioning from TsSslStateDisconnected to TsSslStateDisconnected in response to TsSslEventInvalidState (error code 0x8000FFFF).
RDP ClientActiveX has been disconnected (Reason= 2)
reason 2 is session closed by client.
My paranoia tells me that microsoft went back and patched the image to prevent people from using RDP with docker, but who knows, maybe we're just missing something obvious.

Hyperledger Composer Identity Issue error after network restart (code:20, authorization failure)

I am using Docker Swarm and docker-compose to setup my Fabric (v1.1) and Composer (v0.19.18) networks.
I wanted to test how my Swarm/Fabric networks would respond to a host/ec2 failure, so I manually reboot the host which is running the fabric-ca, orderer, and peer0 containers.
Before the reboot, everything runs perfectly with respect to issuing identities. After the reboot, though all of the Fabric containers are restarted and appear to be functioning properly, I am unable to issue identities with the main admin#network card.
After reboot, composer network ping -c admin#network returns successfully, but composer identity issue (via CLI or javascript) both return code 20 errors as described here:
"fabric-ca request register failed with errors [[{\"code\":20,\"message\":\"Authorization failure\"}]]"
I am guessing the issue is stemming from the host reboot and some difference in how it is restarting the Fabric containers. I can post my docker-compose files if necessary.
If your fabric-ca-server has restarted and it's registration database hasn't been persisted (for example the database is stored on the file system of the container and loss of that container means loss of the contents of that file system) then the ca-server will create a completely new bootstrap identity called admin for issuing identities and it won't be the one you have already have and therefore isn't a valid identity anymore for the fabric-ca-server. Note that it will be a valid identity for the fabric network still. So this is why you now get authorisation failure from the fabric-ca-server. The identity called admin that you currently have is not known to your fabric-ca-server anymore.

Networking issue using Hashicorp Otto on Ubuntu running on vmware?

I am running the following:
Ubuntu 15.05 ("Wily")
Virtual Box 5.0.8
Vagrant 1.7.4
Otto 0.1.2
All seems to have installed fine after I followed How to install Hashicorp's Otto tutorial.
However, each time I run otto dev my internet connection seems to go down (meaning I get a little notify box in my right top corner that tells me that a connection has been established and I'm connected to vboxnet0 and then it tells me my ethernet connection is disconnected) and I get the following error:
pc#pc:~/development/my-rails-app$ otto dev
==> Creating local development environment with Vagrant if it doesn't exist...
Raw Vagrant output will begin streaming in below. Otto does
not create this output. It is mirrored directly from Vagrant
while the development environment is being created.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run vagrant up while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
Error building dev environment: Error executing Vagrant: exit status 1
The error messages from Vagrant are usually very informative.
Please read it carefully and fix any issues it mentions. If
the message isn't clear, please report this to the Otto project.
pc#pc:~/development/my-rails-app$
Any ideas? Is this a problem with using otto on a virtual machine?
I am new to Otto, but I had a similar error. The cause of this error in my case: I first attempted to set up in Vagrant, i.e. created a vagrantfile, than attempted to run Otto.
My Vagrantfile was using an ubuntu image, but it was different from the image Otto was trying to use when guessing at my app structure. Since Otto is supposed to be the tool to abstract Vagrant (and others), I figured I would let it do the work. So deleting my Vagrantfile solved the issue for me - basically, the two vagrantfiles were conflicting.
You can go in and customize your vagrantfile and otto appfile etc., but this got me up and running.
there was a change in wily64 to rename the ethernet devices from eth0 to a more standardized one, which could lead to disconnecting on bootup.
Eventually this can help you:
https://gist.github.com/brbsix/b70413dec907906ef659
This is probably not a networking issue but VMware misconfiguration.
Vagrant (VirtualBox) will complain if the vmx flag is not visible to the guest OS. You need to make sure cat /proc/cpuinfo |grep vmx is not be empty.
If you are using VMware Player then turn the vm off, go to Virtual Machine Settings, Processors and enable Virtualize Intel VT-x/EPT or AMD-V/RVI.

How do you host a Ruby on Rails application on a local network, so multiple people can access it?

I'm brand new to RoR and have pretty much 0 experience with it. I have been handed down somebody else's project and I need to find a way to host the application, so people can just access it locally. The application is a spider script/walker script/web scraper whatever you call it. Basically it connects to a website, logs in, retrieves certain data each day and maps it with the previous data. While on the local machine, you use it, go to localhost:3000, and you get the webpage the previous person designed. I was just wondering how I could get that page to be public for the people on our local network, so they could connect to some arbitrary IP and see the same page (it updates daily)?
What I tried doing is making the folder containing the application public to the network, but in order to use it, I would have to make everybody on the network allowed to write to it and each person would have to install RoR to use it. I want to avoid that since it doesn't seem logical, nor is it what I'm trying to do.
Looking at the code, I can reverse engineer and understand what it does, but when it comes to hosting web apps locally or something of that sort, I have never done this before. Please help!
Thanks in advance!
**EDIT
-This is all being done on a Windows 7 machine.
Since you're on Windows, open up a command line and run ipconfig to find out your local IP. It will be listed under 'IP Address'.
Tell people in your LAN to access http://192.168.x.x:3000 replacing 192.168.x.x by your IP address from step 1.
EDIT: One major thing that I missed, you are windows. On windows u could use thin and put it behind a load balancer. Although i would suggest hosting it on a UNIX machine :)
Although Running it in webrick(webrick is the application server for development i.e when u run rails s) will let other users access the website NEVER do the same for a production application. If you want to run this application in production, u need more powerful application servers like passenger. I would suggest you use it with Apache or Nginx instead of stand alone passenger. Once all this is setup others can use your application by entering the IP(xx.xx.xx.xx) also u can ask your system admin to setup a local DNS so your users need not remember the IP address always.
Description:
While starting Rails Server, we can also setup some options to configure the IP address and also the port number of the site under development environment to host the website in local network. So if we want to change the IP from http://127.0.0.1:3000 to http://192.168.x.x:port (x= 0 to 255 any one number), we can set that in Rails server command! But for this, we will need to find out our current IP address at our current network which will help us to serve the website in local network.
So at first step:
We will open our terminal on our PC. For Android user, we need to open Termux app. Then simply type ifconfig to get the IP address of our device in the current network. We will get an output like this one (Here I'm using Android device for development. So output might be something different than this one on your PC terminal but the process is same):
$ ifconfig
Warning: cannot open /proc/net/dev (Permission denied). Limited output.
lo: flags=XX<UP,LOOPBACK,RUNNING> mtu XXXXX
inet 127.0.0.1 netmask 255.XXX.XXX.XXX
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen XXXX (UNSPEC)
wlan0: flags=XXXX<UP,BROADCAST,RUNNING,MULTICAST> mtu XXXX
inet 192.168.1.103 netmask 255.XXX.XXX.XXX broadcast 192.168.1.255
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen XXXX (UNSPEC)
X= some numbers with our device credentials which is dummied with this variable
If you are using a WiFi router then we will need the wlan0 part to get our device IP. Under wlan0 section there is a subsection of inet showing our current IP! YUP, we need that IP address 192.168.1.103! This might be different for your device and network. This is the key of this mission! Now we're going to the second important step.
So the Second Step is:
That required input command to configure the IP address.
rails s -b 192.168.1.103 -p 8080
Here:
rails s for rails server
-b 192.168.1.103 for bidding the IP address for customisation from the default IP http://127.0.0.1 which is our localhost address.
-p 8080 for port setup. This part is optional. Default port is 3000.
This is the process of changing the localhost IP (http://127.0.0.1) to local network IP which will be available for other device of the same network user.
Now our rails app is available in our local network! Other users in the same network will also be able to visit the website while the server command is running. And the link will be http://192.168.1.103:8080 if you also configure the port number. Otherwise if you have used the command rails s -b 192.168.1.103 without port configuration the link will be: http://192.168.1.103:3000
Again: 192.168.1.103 was for my case, your IP address will be different for your device. That will be needed to use for your server and link address.

Resources