You are not logged in.

#1 2019-06-03 16:36

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Network connection on raspberry Pi without display

I have been using Raspbian on my Pi and have used the following method to enable ssh and obtain Ip from my router without having to be connected to a display (headless)

1. Create empty file in boot partition names "ssh"
2. Create file "wpa_supplicant.conf" in boot partition with the following content.

    country=GB
    update_config=1
    ctrl_interface=/var/run/wpa_supplicant GROUP=netdev

    network={
    ssid="My SSID"
    psk=my_encoded_network_key
    }

I get the encoded network key using wpa_passphrase to prevent using passkeys in clear text.

I tried to do this using the Q4OS image but it fails (I wasn't really surprised as it is quite a different setup), is there a method to get a network connection and enabling ssh (i don't know if #1 has worked) without having to connect to a screen?

Offline

#2 2019-06-03 17:23

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,223
Website

Re: Network connection on raspberry Pi without display

Q4OS features network manager, so you should be able to use "nmcli" and "nmtui" commandline tools. You can connect to a wireless network:
$ nmcli device wifi connect network_name
or just run:
$ nmtui
Installing ssh:
$ sudo apt install ssh

Offline

#3 2019-06-03 17:44

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Network connection on raspberry Pi without display

That assumes I can get a connection to the Raspberry Pi, I am trying to get this to work "headless" that is without a display, and therefore I need a network connection before I can do anything else.

It is possible for me to connect a screen, keyboard and mouse to the Pi but it kind of defeats the purpose of what I am trying to do at the moment. I was hoping it could do the same as Raspbian does with the config files at first boot using the ssh file to enable ssh connections and then get a network connection using the wpa_supplicant.conf.

I will try and copy my laptop connection file from etc/NetworkManager/system-connections/ to the Pi (same location) and see if that works.

EDIT:
It did work and after installing (via ssh) realvnc-vnc-server I could use the remote desktop to finish setting up Q4OS.
I have a few more tests to run and when I'm done I will put a little how-to up on my website and obviously post here for others to see too. smile

Last edited by Dai_trying (2019-06-03 19:32)

Offline

#4 2019-06-03 19:32

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,223
Website

Re: Network connection on raspberry Pi without display

Oh, the Raspbian's method to get initial network connection with ssh is not usable on Q4OS. Perhaps it would be possible to get a login via a serial line.

Offline

#5 2019-06-03 19:37

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,223
Website

Re: Network connection on raspberry Pi without display

Dai_trying wrote:

It did work and after installing (via ssh) realvnc-vnc-server I could use the remote desktop to finish setting up Q4OS.
I have a few more tests to run and when I'm done I will put a little how-to up on my website and obviously post here for others to see too. smile

Great, we will check and possibly include that into the Q4OS documentation.

Offline

#6 2019-06-03 19:45

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Network connection on raspberry Pi without display

You're welcome, I think either the empty ssh file worked or Q4OS allows ssh by default, I can't say which at the moment but I will add this to my test list and put it in the How-To. smile
I have to get a couple more MicroSd Cards as I have taken my cards from my action cameras to use for now and will likely have to put them back as I need to, but I'm sure eBay delivery will be pretty quick so it shouldn't take too long. smile

Offline

#7 2019-06-04 15:17

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Network connection on raspberry Pi without display

After a few tests I found that using the blank ssh file in the boot partition does work and is required if you want to run headless, I tried without it and the connection was always refused.

I am now trying to figure out how to manually create the connection information file to place in etc/NetworkManager/system-connections/ I think this is quite important as I do not always have a WiFi connected installation to hand and would like to find a way to create this file from the connection information that I already have. So basically I need to know what is the minimum required information I have to put in this file?

Offline

#8 2019-06-04 15:21

jotapesse
Member
From: Algarve, Portugal
Registered: 2019-03-23
Posts: 67

Re: Network connection on raspberry Pi without display

You could create/edit/look at that config file with NetworkManager on your PC and replicate it to your RPi?


jotapesse - Obrigado / Thank you.

Offline

#9 2019-06-04 15:28

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Network connection on raspberry Pi without display

I know I can simply copy the file across from my laptop to the SdCard (which I have already done successfully) but I am writing a How-To and need to be able to show others how to get this information and I would imagine there would be users that do not have the required file and maybe have no other WiFi devices (specifically with Q4OS installed) and would need to create a fresh connection file.

Offline

Board footer

Powered by FluxBB