Jump to content

digitalsuper8

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by digitalsuper8

  1. Where should I start in the code? Any suggestions on which file to look in? I started in wiringPi.c and I see that I probably have to tweak the function getBoardType(). But where can I find that function? your help is appreciated.
  2. I believe it has to do with the Armbian Kernel where there may be no model name specified? Like H3 or something? The file /proc/cpuinfo, which is a virtual file and I believe its contents are determined by what is in the kernel, doesn't give any model name and gpio is looking for a model name. So gpio readall fails: $ gpio -v readall gives: gpio version: 2.20 Copyright (c) 2012-2014 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty Your NanoPi has an unknown model type. Please report this to support@friendlyarm.com with a copy of your /proc/cpuinfo if possible
  3. So here's a more detailed explanation for getting the Nanopi Neo Air to act as wifi accesspoint after boot. I used the FergusL scripts for inspiration and for understanding the contents of the various conf files needed. So after disabling hostapd and dnsmasq I wrote the following bash script, in the directory /usr/local/bin/. It's called neoaccesspoint. sudo nano /usr/local/bin/neoaccesspoint #!/bin/bash PATH="$PATH:/usr/bin/" case "$1" in start) # Assumption: NetworkManager systemd service is stopped and disabled # Assumption: dnsmasq is disabled from startup # Assumption: hostapd is disabled from startup # We first have to bring wlan0 down echo "Bringing wlan0 down" ifdown wlan0 # Then remove the dhd module and load it again in operating mode 2 echo "removing module dhd and doing modprobe dhd op_mode2" rmmod dhd modprobe dhd op_mode=2 # we then have to bring wlan0 up again for it to get an IP address echo "bringing wlan0 up again" ifup wlan0 # We then bring up hostapd echo "starting hostapd" /bin/systemctl start hostapd # And we start dnsmasq echo "starting dnsmasq" #/usr/sbin/dnsmasq /bin/systemctl start dnsmasq ;; stop) # type any commmand echo "Stopping MyAP_Startup service: stopping dnsmasq and hostapd and bringing down wlan0" /bin/systemctl stop hostapd /bin/systemctl stop dnsmasq ifdown wlan0 ;; restart) $0 stop $0 start ;; esac exit 0 Then I created a service file in /lib/systemd/system/ sudo nano /lib/systemd/system/neoairaccesspoint.service the contents: [Unit] #This file has to be in /etc/systemd/system/ Description=Manage the neoairaccesspoint script # Example After statement, this unit only starts after the speficied units are active #After=syslog.target network.target [Service] #Type=forking Type=oneshot ExecStart=/usr/local/bin/neoairaccesspoint start RemainAfterExit=true ExecStop=/usr/local/bin/neoairaccesspoint stop ExecReload=/usr/local/bin/neoairaccesspoint restart # We probably don't want to specify the user here #User=npi [Install] WantedBy=graphical.target I enabled this service by the following commands: sudo systemctl daemon-reload sudo systemctl enable neoairaccesspoint.service This should do it after reboot: sudo systemctl reboot Hope it works for you. Of course you have to have your conf files correct for: hostapd.conf dnsmasq.conf and /etc/network/interfaces
  4. All, I downloaded and built WiringNP according to the FriendlyARM instructions. Running 'gpio read all' gives me an error saying piBoardRev: Unable to determine board revision from /proc/cpuinfo for the rest the Neo Air Armbian runs fine. any ideas what's wrong?
  5. I will do a step by step later as you requested. I did my comment from top of mind. on the command you give you may just need to sudo it? sudo /bin/systemctl disable dnsmasq
  6. I have a NanoPi Neo Air now working as wifi accesspoint, showing SSID and allowing me to connect. My first trials with the apmode.sh (thanks FergusL) gave me the same problem that most of you had: There was an SSID being broadcast but I simply couldn't connect. In my case I believe the problem was doing: rmmod dhd modprobe dhd op_mode=2 Because this brought down the wlan0 module and I found out that thereafter the wlan0 doesn't have an IP address anymore. This causes problems for dnsmasq and leads to dnsmasq not issueing ip-addresses to devices that connect to hostapd. So hostapd accepts the password but dnsmasq doesn't provide an IP address so you cannot connect.. So here's what I did: 1. I disabled NetworkManager once (that then makes that permanently disabled at boot up): /bin/systemctl stop NetworkManager /bin/systemctl disable NetworkManager 2. Because Armbian in my case started up hostapd and dnsmasq during boot I disabled those too. /bin/systemctl disable hostapd /bin/systemctl disable dnsmasq 3. I wrote a script that first brings down wlan0 (ifdown wlan0), then runs the ' rmmod dhd' and 'modprobe dhd op_mode=2' commands. After that it brings up wlan0 (ifup wlan0), so that it again gets an IP address (it uses the 'interfaces' file for that). Finally the script starts hostapd and dnsmasq: ifdown wlan0 rmmod dhd modprobe dhd op_mode=2 ifup wlan0 /bin/systemctl start hostapd /bin/systemctl start dnsmasq I created a service based on that script and enabled it with systemctl so that at each boot automatically the nanopi neo air is in wifi accesspoint mode and will broadcast SSID and allows connections. I need to look up the exact script and the service files and will post those. It worked for my set up, hope it helps.
  7. Wow, I had so much trouble in getting the SSID to show when Nanopi Air Neo uses hostapd, I tried everything. The apmode.sh script solved it!
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines