Jump to content

FergusL

Members
  • Posts

    5
  • Joined

  • Last visited

Reputation Activity

  1. Like
    FergusL got a reaction from StuxNet in NanoPi Neo Air Access Point   
    That's super fine, thanks for the mention and I'm glad to see it adopted that quickly!
    I in fact made these script for a projet as well, I'm working on low latency audio software running on the NanoPi.
     
    The only thing that has to be double checked in these scripts is the compatibility with other services running with systemd.
    Yeah please tell me how it works when you've tested it!
     
  2. Like
    FergusL got a reaction from StuxNet in NanoPi Neo Air Access Point   
    Hello! Posting here as it's both the most recent and most precise topic about that issue.
     
    I've managed to make two shell scripts to switch between Access Point and client mode for wifi.
     
    I hope I haven't forgotten any other settings I've tweaked elsewhere on the system.
    I'm not using nmcli/tui for creating the AccessPoint since the load option of the module makes this a bit tricky.
    Instead this is standard hostapd for AP settings + dnsmasq for serving DHCP.
     
    As stated in the files, this needs testing as well as checking regarding how to deal exactly with systemd services.
     
    Save as stamode.sh, chmod +x stamode.sh and ./stamode
    #! /bin/sh # Switch from Access Point mode to station mode (client mode to a wifi network) for AP6212. #TODO: Help, review and testers needed, especially for dealing with stopping/killing systemd services and process. # Stop running process for the AP /bin/systemctl stop hostapd kill $(cat /var/run/dnsmasq.pid) # Remove and re-add the wifi module, that time in station mode. rmmod dhd modprobe dhd # Update symlinks for interfaces rm /etc/network/interfaces ln -s interfaces.network-manager /etc/network/interfaces # Start normal network services provided by NM. /bin/systemctl start networking.service /bin/systemctl enable NetworkManager /bin/systemctl start NetworkManager # NM needs to be told to use that interface again /usr/bin/nmcli d set wlan0 managed yes # Wait for wifi to come up and show a list of networks in range sleep 8 /usr/bin/nmcli device wifi list Save as apmode.sh, chmod +x apmode.sh and ./stamode
    #! /bin/sh # Switch from station mode (client mode to a wifi network) to Acess Point mode for AP6212. # Configuration of hostapd is found in /etc/hostapd/hostapd.conf or wherever the line "DAEMON_CONF" in /etc/default/hostapd points to. # Do not forget to uncomment the line mentioned above in /etc/default/hostapd # Edit /etc/network/interfaces with static IP for wlan0, example conf: # auto wlan0 # iface wlan0 inet static # address 192.168.101.1 # netmask 255.255.255.0 # dns-nameservers 192.168.101.1 # Configuration for DHCP server (using dnsmasq) is found in /etc/dnsmasq.conf, example conf: # dhcp-range=192.168.101.20,192.168.101.120,72h #TODO: Help, review and testers needed, especially for dealing with stopping/killing systemd services and process. # Stop and disable nm. If it's enabled it locks at boot for 5 minutes. # The dnsmasq processes aren't killed when nm stops and keep dhcp from working, kill them! /bin/systemctl stop NetworkManager /bin/systemctl disable NetworkManager kill $(cat /var/run/NetworkManager/dnsmasq.pid) kill $(cat /run/dnsmasq.br0.pid) # Remove and re-add the wifi module, that time in AP mode rmmod dhd modprobe dhd op_mode=2 # Update symlinks for interfaces rm /etc/network/interfaces ln -s interfaces.hostapd /etc/network/interfaces # Start using systemd and manually. Hostapd manages the interface, auth etc. and dnsmasq serves a DHCP server for clients connecting to the AP. /bin/systemctl start hostapd /usr/sbin/dnsmasq
  3. Like
    FergusL reacted to StuxNet in NanoPi Neo Air Access Point   
    Awesome dude! I was using FriendlyArm's kernel for awhile there since they accomplished this out of the box. However I've been meaning to tinker with this on Armbian for a while, cuz Armbian is dope,. Just haven't had the time. Thanks for beating me to it. Also, I've been kind of documenting my progress, proof of concept and use case for my NanoPi NeoAir.
     
    Now, I hope it's cool but Tkaiser linked me to your post and I immediately made duplicates of your scripts and put them in a gist for personal reference and because I always assume links will die I also reference your scripts in the write up (if you can call it that) meanwhile being sure to give you proper credit  I'll be testing these out and give you feedback when my new order comes in the mail.
     
    If you have any problem with that lemme know and I'll make changes.
     
    Here's the gist: https://gist.github.com/BiTinerary/693b8949ed56d6c534d138b9ba2b837e
    Here's the reference: https://github.com/BiTinerary/PocketServerPi/blob/master/README.md#installation (Second Paragraph)
  4. Like
    FergusL got a reaction from tkaiser in NanoPi Neo Air Access Point   
    Hello! Posting here as it's both the most recent and most precise topic about that issue.
     
    I've managed to make two shell scripts to switch between Access Point and client mode for wifi.
     
    I hope I haven't forgotten any other settings I've tweaked elsewhere on the system.
    I'm not using nmcli/tui for creating the AccessPoint since the load option of the module makes this a bit tricky.
    Instead this is standard hostapd for AP settings + dnsmasq for serving DHCP.
     
    As stated in the files, this needs testing as well as checking regarding how to deal exactly with systemd services.
     
    Save as stamode.sh, chmod +x stamode.sh and ./stamode
    #! /bin/sh # Switch from Access Point mode to station mode (client mode to a wifi network) for AP6212. #TODO: Help, review and testers needed, especially for dealing with stopping/killing systemd services and process. # Stop running process for the AP /bin/systemctl stop hostapd kill $(cat /var/run/dnsmasq.pid) # Remove and re-add the wifi module, that time in station mode. rmmod dhd modprobe dhd # Update symlinks for interfaces rm /etc/network/interfaces ln -s interfaces.network-manager /etc/network/interfaces # Start normal network services provided by NM. /bin/systemctl start networking.service /bin/systemctl enable NetworkManager /bin/systemctl start NetworkManager # NM needs to be told to use that interface again /usr/bin/nmcli d set wlan0 managed yes # Wait for wifi to come up and show a list of networks in range sleep 8 /usr/bin/nmcli device wifi list Save as apmode.sh, chmod +x apmode.sh and ./stamode
    #! /bin/sh # Switch from station mode (client mode to a wifi network) to Acess Point mode for AP6212. # Configuration of hostapd is found in /etc/hostapd/hostapd.conf or wherever the line "DAEMON_CONF" in /etc/default/hostapd points to. # Do not forget to uncomment the line mentioned above in /etc/default/hostapd # Edit /etc/network/interfaces with static IP for wlan0, example conf: # auto wlan0 # iface wlan0 inet static # address 192.168.101.1 # netmask 255.255.255.0 # dns-nameservers 192.168.101.1 # Configuration for DHCP server (using dnsmasq) is found in /etc/dnsmasq.conf, example conf: # dhcp-range=192.168.101.20,192.168.101.120,72h #TODO: Help, review and testers needed, especially for dealing with stopping/killing systemd services and process. # Stop and disable nm. If it's enabled it locks at boot for 5 minutes. # The dnsmasq processes aren't killed when nm stops and keep dhcp from working, kill them! /bin/systemctl stop NetworkManager /bin/systemctl disable NetworkManager kill $(cat /var/run/NetworkManager/dnsmasq.pid) kill $(cat /run/dnsmasq.br0.pid) # Remove and re-add the wifi module, that time in AP mode rmmod dhd modprobe dhd op_mode=2 # Update symlinks for interfaces rm /etc/network/interfaces ln -s interfaces.hostapd /etc/network/interfaces # Start using systemd and manually. Hostapd manages the interface, auth etc. and dnsmasq serves a DHCP server for clients connecting to the AP. /bin/systemctl start hostapd /usr/sbin/dnsmasq
  5. Like
    FergusL got a reaction from Igor in Armbian framework with RT patches no longer builds!!   
    I can confirm the same as of now with version 5.26, option 4 works and option 5 fails.
    This is on NanoPi Air (makes no difference anyway).
     
    The rt patch has changed meanwhile and the file to enable is now: lib/patch/kernel/sun8i-default/30-real-time143-full-plus-rt-fixes.patch.disabled
  6. Like
    FergusL got a reaction from Thomas Pfeiffer in NanoHat PCM5102A for Nano Pi NEO Air   
    I received NanoPi NEO and NEO Air boards along with the NanoHat PCM5102a that FriendlyArm is selling: http://www.friendlyarm.com/index.php?route=product/product&product_id=169
    It's a good quality audio stereo out addon board compatible with NEO and NEO Air.
     
    I got it working with Armbian on NEO Air!
     
    I adapted commits from FA's repo to match Armbian's tree and get that DAC working, (original commits here: https://github.com/friendlyarm/h3_lichee/search?utf8=%E2%9C%93&q=pcm5102a+&type=Commits). 
     
    Add these to 'userpatches/kernel/sun8i-default`: https://gist.github.com/Simon-L/c8c119c86d7d3fe4316387c3ae818379
    Add this config to 'userpatches' to have the driver built-in: https://gist.github.com/Simon-L/56bf6a3ec423e37973ee0da0bc16979f
    Then run './compile.sh'
     
    The fex file also needs to be modified, you can use this one: https://gist.github.com/Simon-L/f0c88190814f0f482773e81512e56553
     
    This should be all that's needed!
    Test it with 'aplay /usr/share/sounds/alsa/Noise.wav'
    and install madplay if you want to try with mp3 files.
     
    Can I safely share the content of the /boot folder and expect it to work for user copy-pasting it to the /boot folder on their sdcard? It has the kernel and the fex which are the only files the process has modified.
    Obviously you'd still have to trust me
     
    I'm trying to turn this into a more straightforward way. Do I need to commit to modify defconfig and .fex file or is it supported in userpatches/ folder as well?
     
    There is one issue reported in syslog that doesn't seem to prevent it from working, here's the relevant part of the log:
    [ 1.598532] pcm5102a_probe [ 1.607823] asoc: snddaudio <-> pri_dai mapping ok [ 1.610531] ------------[ cut here ]------------ [ 1.610583] WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0x8c/0xac() [ 1.610604] sysfs: cannot create duplicate filename '/devices/platform/snddaudio' [ 1.610625] Modules linked in: [ 1.610694] [<c0016a20>] (unwind_backtrace+0x0/0xe8) from [<c0617cc0>] (dump_stack+0x20/0x24) [ 1.610742] [<c0617cc0>] (dump_stack+0x20/0x24) from [<c0029750>] (warn_slowpath_common+0x5c/0x74) [ 1.610788] [<c0029750>] (warn_slowpath_common+0x5c/0x74) from [<c00297a8>] (warn_slowpath_fmt+0x40/0x48) [ 1.610833] [<c00297a8>] (warn_slowpath_fmt+0x40/0x48) from [<c017aab8>] (sysfs_add_one+0x8c/0xac) [ 1.610877] [<c017aab8>] (sysfs_add_one+0x8c/0xac) from [<c017acb8>] (create_dir+0x70/0xc4) [ 1.610917] [<c017acb8>] (create_dir+0x70/0xc4) from [<c017b0bc>] (sysfs_create_dir+0xc4/0xe4) [ 1.610965] [<c017b0bc>] (sysfs_create_dir+0xc4/0xe4) from [<c0306bf0>] (kobject_add_internal+0xdc/0x1d0) [ 1.611013] [<c0306bf0>] (kobject_add_internal+0xdc/0x1d0) from [<c0306ef8>] (kobject_add+0x78/0x90) [ 1.611064] [<c0306ef8>] (kobject_add+0x78/0x90) from [<c03b0078>] (device_add+0xf8/0x578) [ 1.611114] [<c03b0078>] (device_add+0xf8/0x578) from [<c03b4208>] (platform_device_add+0x110/0x16c) [ 1.611161] [<c03b4208>] (platform_device_add+0x110/0x16c) from [<c03b47a4>] (platform_device_register+0x30/0x34) [ 1.611214] [<c03b47a4>] (platform_device_register+0x30/0x34) from [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4) [ 1.611263] [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4) from [<c000867c>] (do_one_initcall+0xa8/0x164) [ 1.611313] [<c000867c>] (do_one_initcall+0xa8/0x164) from [<c08d1a74>] (kernel_init+0x168/0x254) [ 1.611364] [<c08d1a74>] (kernel_init+0x168/0x254) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8) [ 1.611455] ---[ end trace bd16a9742f20e8dd ]--- [ 1.611481] ------------[ cut here ]------------ [ 1.611509] WARNING: at lib/kobject.c:198 kobject_add_internal+0x180/0x1d0() [ 1.611533] kobject_add_internal failed for snddaudio with -EEXIST, don't try to register things with the same name in the same directory. [ 1.611560] Modules linked in: [ 1.611601] [<c0016a20>] (unwind_backtrace+0x0/0xe8) from [<c0617cc0>] (dump_stack+0x20/0x24) [ 1.611644] [<c0617cc0>] (dump_stack+0x20/0x24) from [<c0029750>] (warn_slowpath_common+0x5c/0x74) [ 1.611686] [<c0029750>] (warn_slowpath_common+0x5c/0x74) from [<c00297a8>] (warn_slowpath_fmt+0x40/0x48) [ 1.611732] [<c00297a8>] (warn_slowpath_fmt+0x40/0x48) from [<c0306c94>] (kobject_add_internal+0x180/0x1d0) [ 1.611778] [<c0306c94>] (kobject_add_internal+0x180/0x1d0) from [<c0306ef8>] (kobject_add+0x78/0x90) [ 1.611825] [<c0306ef8>] (kobject_add+0x78/0x90) from [<c03b0078>] (device_add+0xf8/0x578) [ 1.611870] [<c03b0078>] (device_add+0xf8/0x578) from [<c03b4208>] (platform_device_add+0x110/0x16c) [ 1.611915] [<c03b4208>] (platform_device_add+0x110/0x16c) from [<c03b47a4>] (platform_device_register+0x30/0x34) [ 1.611962] [<c03b47a4>] (platform_device_register+0x30/0x34) from [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4) [ 1.612007] [<c08f6f94>] (sunxi_snddaudio0_init+0x54/0xa4) from [<c000867c>] (do_one_initcall+0xa8/0x164) [ 1.612052] [<c000867c>] (do_one_initcall+0xa8/0x164) from [<c08d1a74>] (kernel_init+0x168/0x254) [ 1.612098] [<c08d1a74>] (kernel_init+0x168/0x254) from [<c000f1b0>] (kernel_thread_exit+0x0/0x8) [ 1.612125] ---[ end trace bd16a9742f20e8de ]--- Any hint? The codec still works fine. There is no control in alsamixer.
     
    Thanks to @tkaiser and @Igor for their help on IRC.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines