I'm trying to create a wireless hotspot with the Raspberry Pi in a dockerized environment.

When I run

sudo /usr/sbin/hostapd -d /etc/hostapd/hostapd.conf

I'm getting the following error:

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
'ine 3: unknown hw_mode '

Config file:


My config file seems to be right. There are no extra white spaces or things like that. I got the hotspot working earlier without Docker (directly on the OS).

I'm running the Docker instance with following command:

docker run -it --net=host [censored]/poc-communicatie_hub

My docker file is as following:

FROM hypriot/rpi-java:1.8.0
RUN apt-get update
RUN apt-get install -y net-tools
RUN apt-get install hostapd
ADD /vendor/hostapd.conf /etc/hostapd/hostapd.conf
CMD ["/bin/bash"]

When I run ifconfig -a in my container, I see the wlan0, so I do seem to have access to it.

  • I have an update on this. I just ran cat -v hostapd.conf and got the following output: interface=wlan0^M ssid=Test^M hw_mode=g^M channel=6^M macaddr_acl=0^M auth_algs=1^M ignore_broadcast_ssid=0^M wpa=2^M wpa_passphrase=12345678^M It seems like the Windows is adding some control characters to the file when transfering.. Any idea on how I can avoid this?
    – Jérémy
    Feb 15 '18 at 10:19

As I said in the comment, the problem was caused by creating the file in Windows. Doing this added ^M to the end of each line. (You can check if this is the case by executing the command cat -v hostapd.conf. I fixed this by creating the same file on Linux and using this one for adding into the Docker image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.