Ubuntu linux on Picocalc (with luckfox lyra SBC) tinkering megathread

mostly DNS problem(you can confirm it with ping any url),and you may need
to share your uconsole internet connection to the rndis interface (I only tryed this with Windows 10,I will comfirmed it together)

1 Like

Checked,RNDIS fully work on linux,NAT forwarding is needed on the uConsole. as well

【Internet】<-- wlan -->【uConsole(NAT forwarding)】<-- RNDIS -->【PicoCalc】


looks like I need to write some thing about RNDIS network.

1 Like

Connecting to the Internet via USB(RNDIS)

I’ve noticed many people struggling with using apt when a Wi-Fi connection hasn’t been established. In reality, you can easily obtain a network connection through the USB-C port on the Lyra via RNDIS.

Prerequisite: A PC with internet access (Linux or Windows).

Configuration (Picocalc side)

First, you need to configure the IP address and DNS for the usb0 interface (the RNDIS interface) on the Picocalc. You can run the following script:

#!/bin/bash

# Set IP and bring up the interface
ifconfig usb0 192.168.10.2 netmask 255.255.255.0 up

# Set the PC as the default gateway
route add default gw 192.168.10.1

# Set Google DNS
echo "nameserver 8.8.8.8" > /etc/resolv.conf`

Note: In this RNDIS network, 192.168.10.2 is the Picocalc and 192.168.10.1 is your Host PC. You can modify these values as needed.


Configuration (Windows Host)

  1. Connect your PC to the Picocalc Lyra using a USB data cable. Under Control Panel > Network Connections, you should see a new adapter identified as a “Remote NDIS based Internet Sharing Device.”
  2. Find the adapter your PC currently uses for internet (e.g., “WLAN” or “Ethernet”).
  3. Right-click the adapter → PropertiesSharing tab.
  4. Check “Allow other network users to connect through this computer’s Internet connection.”
  5. Select the RNDIS adapter from the dropdown menu and click OK. Windows will now automatically handle routing for this device.
  6. Ensure the IP of RNDIS interface on the PC is set to 192.168.10.1. When Picocalc sets its gateway to 10.1, its traffic will be forwarded through your PC’s active internet connection.

Configuration (Linux Host)

Linux setup is even more straightforward. The Picocalc side remains the same. Run these commands on your Host PC (assuming your internet source is wlan0 and the Lyra is usb0; replace names if necessary):

1. Set the RNDIS IP on the Host:

sudo ifconfig usb0 192.168.10.1 netmask 255.255.255.0 up`

2. Enable Network Forwarding and NAT:

# Enable IP forwarding
sudo sysctl -w net.ipv4.ip_forward=1
# Configure iptables for masquerading
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i usb0 -o wlan0 -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o usb0 -m state --state RELATED,ESTABLISHED -j ACCEPT`
1 Like

Simple USB DHCP Configuration (Linux Host) - Internet Connection Sharing

No need for iptables and setting sysctl ipv4 ip forwarding

1. Determine the USB Connection name used for the Luckfox Lyra:

It typically wont be Wired connection 1

nmcli connection show

example

NAME UUID TYPE DEVICE
Wired connection 100 c57d31eb-bd98-365d-94df-60c2b875d4cc ethernet –

2. Apply shared internet connection:

sudo nmcli connection down "Wired connection 100"
sudo nmcli connection modify "Wired connection 100" ipv4.method shared 
sudo nmcli connection up "Wired connection 100"

3. Obtain a DHCP client IP for Luckfox Lyra

adb shell dhclient usb0

Setting LLMNR support level “yes” for “2”, but the global support level is “no”.

4. View IP Address chosen for Luckfox Lyra

arp
Address                  HWtype  HWaddress           Flags Mask            Iface
10.42.0.126              ether   16:cf:d3:c6:1b:2c   C                     enx5a85fb60f7cd
2 Likes

Now have ethernet over usb0

Ping ok, ssh ok

sudo update ok

sudo upgrade fail on 52%

make still reporting an error, not able to compile my driver…

No offense, but is there a Discord where we can spam a little more freely? :grinning_face_with_smiling_eyes:

Sure,I make a discord channel for this post,Welcome to share your experience with using the device!

1 Like

why not just use the official discord that already exists?

Requirements for Setting Up the Build Environment

Although it is a bit of a “patchwork” solution, I have uploaded my build environment to GitHub. By following the instructions in the repository, you can quickly set up a build environment identical to mine. This will allow you to easily customize your kernel configuration via ./build.sh kconfig.

Generally, compiling drivers requires the Linux headers and kernel configuration, both of which are included in this SDK.

The GitHub repository link is provided below:

1 Like

Don’t use Discord, with its new ‘age verification’ ‘feature’ – as we know from a recent security breach at Discord, there is no reason to trust Discord to be secure. There is no way I would hand over ‘verification’ data to Discord myself.

Rather, use something like the traditional IRC.

Great, thank you for your extra effort.

Have fresh copy of your above Ubuntu…

It seems that we have some error in “prepare” script path =>

My repository only contains the essential configuration files (you can think of it as a patch for the SDK specifically for Picocalc). To set up the entire build environment, you first need to configure the SDK. Please take special note: the Luckfox SDK is designed for x86 architectures and has specific requirements for the Ubuntu version and Python version. To avoid unnecessary trouble, try to keep your environment strictly consistent with the official requirements. (Detailed tutorials on how to build the SDK can be found on the official wiki.) Once the SDK is ready, git clone my repository into the SDK directory, select my configuration file, and you can proceed with the kernel build.

Regrettably, due to the way the Linux driver mechanism works, your driver must maintain a specific “matching” relationship with the compiled kernel. In other words, you must target a specific kernel version and configuration for the compiled driver to be compatible; otherwise, you may encounter all sorts of strange issues. My current expertise is still limited, but I will try to include the kernel headers in the image in the future to enable on-device driver compilation on the Picocalc. (Though, given the Picocalc’s performance, compiling drivers locally is honestly a test of patience.)

One last thing: the RTW_88 driver set you can download is primarily targeted at x86 architectures and may not necessarily account for ARM scenarios. Therefore, relying solely on the official make or make install will likely lead to various unpredictable problems. You need to read the Makefile and understand exactly what it is doing. (Gemini is an excellent teacher—you can paste the entire Makefile directly, and after describing your background in detail, it can provide plenty of technical advice and direct guidance.)

Thank you for your patience and detail explanation :+1:

Decided to move on to Calculinux Alpha 7 release…

Like Ubuntu & have two notebooks on that platform, but…

For PicoCalc with Lyra, afraid that my time is limited to spent on reinventing the wheel aka wifi.

Calculinux is up and running, wifi network working like charm :wink:

1 Like

After correcting the parts of your network-related kernel settings that differed from those in markbirss’s image and rebuilding, my network driver also worked without any issues.
I was finally able to get the DRM driver and the picocalc SD card fully working.

However, I couldn’t get audio and the keyboard working with the drivers I compiled, so I used the prebuilt files instead. It would be helpful if there were a guide about this.

The setup wasn’t easy, but it’s impressive.

Note: According to the Linux driver architecture, .ko (Kernel Object) driver modules must strictly match the specific Linux kernel version they were compiled against. The Linux kernel does not provide a stable Kernel Module Application Binary Interface (ABI); instead, driver modules depend on specific kernel symbol tables, data structure definitions, and configurations.

Therefore, there is a high probability that your previously compiled drivers will be incompatible with my modified kernel. I have updated the GitHub repository to include the source code for my keyboard and audio drivers.

If you need to recompile your own audio/keyboard drivers, please keep the following in mind:

Environment Sync: As mentioned above, you must rebuild the SDK environment with my repository. You should successfully compile the kernel first before attempting to compile the module drivers. This ensures you obtain the correct kernel symbol tables and related information, which are typically only generated after a full kernel build.

DTS Matching: Since I have also modified the DTS (Device Tree Source) files, ensure that the .compatible strings in your driver source code match those used in the DTS (specifically “picocalc,picocalc-keyboard” and “fsl,picocalc-snd-pwm”).