Author Topic: USB Ethernet adapter use  (Read 5504 times)

defunked

  • Newbie
  • *
  • Posts: 24
    • View Profile
USB Ethernet adapter use
« on: September 01, 2018, 11:55:53 am »
I am trying to use a USB Ethernet adapter on my Gemini.  I installed the usbutils package to get access to the lsusb command.  This shows the ethernet USB device when plugged into the Gemini's left USB port.  However, the interface doesn't show up in the ifconfig -a command result. I have no idea how sailfish detects and changes the network interface list.  Since sailfish has no /etc/network directory, I assume networking setup involves the systemd beast.   Has any one been able to get a USB Ethernet adapter to working?

depscribe

  • Sr. Member
  • ****
  • Posts: 254
    • View Profile
USB Ethernet adapter use
« Reply #1 on: September 02, 2018, 01:04:55 am »
Quote from: defunked
I am trying to use a USB Ethernet adapter on my Gemini.  I installed the usbutils package to get access to the lsusb command.  This shows the ethernet USB device when plugged into the Gemini's left USB port.  However, the interface doesn't show up in the ifconfig -a command result. I have no idea how sailfish detects and changes the network interface list.  Since sailfish has no /etc/network directory, I assume networking setup involves the systemd beast.   Has any one been able to get a USB Ethernet adapter to working?
If memory serves -- and I'm not entirely sure that it does -- ethernet over USB isn't supported in any of the Linuxen for Gemini. Though it apparently has been made to work. Here's what I could find on the subject:

https://together.jolla.com/question/177728/...hernetmicrousb/

https://together.jolla.com/question/113950/...on-through-usb/

HTH.
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket

depscribe

  • Sr. Member
  • ****
  • Posts: 254
    • View Profile
USB Ethernet adapter use
« Reply #2 on: September 03, 2018, 02:21:56 pm »
Quote from: defunked
I am trying to use a USB Ethernet adapter on my Gemini.  I installed the usbutils package to get access to the lsusb command.  This shows the ethernet USB device when plugged into the Gemini's left USB port.  However, the interface doesn't show up in the ifconfig -a command result. I have no idea how sailfish detects and changes the network interface list.  Since sailfish has no /etc/network directory, I assume networking setup involves the systemd beast.   Has any one been able to get a USB Ethernet adapter to working?
Just to make sure: you've gone to Settings > Developer mode > Networking and noted what you found there?
dep

Atari Portfolio (yes, it still works and yes, I bought it new)
Libretto 110 CT (with docking station and all kinds of PCMCIA stuff)
And, now, a Gemini and, fortunately, a GPD Pocket

defunked

  • Newbie
  • *
  • Posts: 24
    • View Profile
USB Ethernet adapter use
« Reply #3 on: September 03, 2018, 03:27:05 pm »
Quote from: depscribe
Quote from: defunked
I am trying to use a USB Ethernet adapter on my Gemini.  I installed the usbutils package to get access to the lsusb command.  This shows the ethernet USB device when plugged into the Gemini's left USB port.  However, the interface doesn't show up in the ifconfig -a command result. I have no idea how sailfish detects and changes the network interface list.  Since sailfish has no /etc/network directory, I assume networking setup involves the systemd beast.   Has any one been able to get a USB Ethernet adapter to working?
Just to make sure: you've gone to Settings > Developer mode > Networking and noted what you found there?

The USB Ethernet setting has an IP address set appropriate for the wired network I am trying to use...  as I set it manually while trying to figure this out.  That setting is present regardless of the presence of my USB Ethernet adapter.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
USB Ethernet adapter use
« Reply #4 on: September 03, 2018, 05:12:08 pm »
As far as I know, the USB networking setting is for USB Ethernet, not a USB *to* Ethernet adapter. There is a standard for USB networking which emulates ethernet and provides a normal interface. If you use linux, everything should work ootb. You connect your USB cable from the gemini to the PC, and at each end an interface is created. There is no adapter required.

I have a hub with an ethernet device which doesn't seem to work under sailfish. As I haven't needed ethernet, I really haven't had much of a play other than lsusb and dmesg to make sure it is seen. I'm sure with a bit of playing it could be made to work. The USB Ethernet device is normally used by developers to connect to an embedded device. It is fast, and allows the usual tools to be used (ssh, scp etc).

To get the USB to Ethernet adapter working, the kernel needs to recognise it. This needs a kernel module, either compiled in, or loaded. I suggest looking at the journal output to see if it is recognised. If it isn't, you would need to get/build a module for the gemini which would require the kernel source (or at minimum headers).

If WiFi isn't an option for your network, try USB networking to your PC with the normal USB cable.

EDIT: Just for fun I connected my gemini to my PC (running Ubuntu 16.10) and got USB ethernet working. To do this, do the following:

Before connecting the USB cable,
1) Enable developer mode: settings->Development Tools->Developer mode

1a) (optional) Enable remote connection so you can ssh into the gemini: settings->Development Tools->Remote connection

2) Set the USB network address: settings->Development Tools->USB IP address

3) Set the USB to use developer mode: settings->USB->Default USB mode = Developer mode

4) Connect the USB cable from the gemini to the PC

5) Both devices should detect the connection and create interfaces

6) Enjoy

You can set up routing so that the gemini connects to the world via the USB cable if you so wish, but the most useful thing is copying data to/from the device at high speed.
« Last Edit: September 03, 2018, 05:24:56 pm by vader »

defunked

  • Newbie
  • *
  • Posts: 24
    • View Profile
USB Ethernet adapter use
« Reply #5 on: September 03, 2018, 06:22:40 pm »
Quote from: vader
As far as I know, the USB networking setting is for USB Ethernet, not a USB *to* Ethernet adapter. There is a standard for USB networking which emulates ethernet and provides a normal interface. If you use linux, everything should work ootb. You connect your USB cable from the gemini to the PC, and at each end an interface is created. There is no adapter required.

I have a hub with an ethernet device which doesn't seem to work under sailfish. As I haven't needed ethernet, I really haven't had much of a play other than lsusb and dmesg to make sure it is seen. I'm sure with a bit of playing it could be made to work. The USB Ethernet device is normally used by developers to connect to an embedded device. It is fast, and allows the usual tools to be used (ssh, scp etc).

To get the USB to Ethernet adapter working, the kernel needs to recognise it. This needs a kernel module, either compiled in, or loaded. I suggest looking at the journal output to see if it is recognised. If it isn't, you would need to get/build a module for the gemini which would require the kernel source (or at minimum headers).

If WiFi isn't an option for your network, try USB networking to your PC with the normal USB cable.

That explains the USB Ethernet setting. My hope was to use a USB-to-Ethernet adapter for field work, eliminating the need to haul a full laptop computer around.  System logging in sailfish seems minimal by default.  I assume logging is now controlled by systemd correct? Any idea how to "up" the logging verbosity?  I hate systemd.  It reminds me of Apple's launchd crap. Time to learn yet another standard-by-decree start-up system.  And thanks for the lead on using dmesg.  I forgot about that.

I probably messed up my ability to use the official Sailfish developer tools IDE.  Not that I have been able to get any example code to work on the IDE anyway, either through emulation, or on the Gemini via developer USB connection.  Maybe I should stick to hardware development.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
USB Ethernet adapter use
« Reply #6 on: September 03, 2018, 09:04:14 pm »
Quote from: defunked
I probably messed up my ability to use the official Sailfish developer tools IDE.  Not that I have been able to get any example code to work on the IDE anyway, either through emulation, or on the Gemini via developer USB connection.  Maybe I should stick to hardware development.

It may be old school, but I program directly on the gemini. I've installed some -devel packages, gcc,make,autogen... and tIDE and found it works well. You could ssh in to the gemini and use the PC as a terminal if you want. It works quite well for git/sourceforge code where you run configure/make. I found a demo sailfish qml file which pretty much shows how all the sailfish components work, and the tIDE default package has a basic multipage project you can modify.

If you were looking at getting SDL apps compiling on the gemini, I can give you some pointers. Once you know the tricks, porting is much easier.

defunked

  • Newbie
  • *
  • Posts: 24
    • View Profile
USB Ethernet adapter use
« Reply #7 on: September 04, 2018, 11:27:00 am »
Quote from: vader
Quote from: defunked
I probably messed up my ability to use the official Sailfish developer tools IDE.  Not that I have been able to get any example code to work on the IDE anyway, either through emulation, or on the Gemini via developer USB connection.  Maybe I should stick to hardware development.

It may be old school, but I program directly on the gemini. I've installed some -devel packages, gcc,make,autogen... and tIDE and found it works well. You could ssh in to the gemini and use the PC as a terminal if you want. It works quite well for git/sourceforge code where you run configure/make. I found a demo sailfish qml file which pretty much shows how all the sailfish components work, and the tIDE default package has a basic multipage project you can modify.

If you were looking at getting SDL apps compiling on the gemini, I can give you some pointers. Once you know the tricks, porting is much easier.

I have not been able to get anything built in the IDE.  Things seem to compile with out errors, but I can't get them to run in the simulator or on my Gemini.  So how do I get started building on the Gemini directly?  Is this done through a configure/make script process?  Any leads on good documentation for the actual build process?

Thanks.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
USB Ethernet adapter use
« Reply #8 on: September 04, 2018, 09:07:30 pm »
Quote from: defunked
I have not been able to get anything built in the IDE.  Things seem to compile with out errors, but I can't get them to run in the simulator or on my Gemini.  So how do I get started building on the Gemini directly?  Is this done through a configure/make script process?  Any leads on good documentation for the actual build process?
I installed gcc-4.8.3 and gcc-c++-4.8.3 from jolla from the command line:

pkcon install gcc
pkcon install gcc-c++

It should install the libs needed for you.

You probably also want to install things like make, automake, ...

pkcon install make
pkcon install automake

I installed tIDE (either from openrepos or jolla) as it makes building the rpms easy. You won't have an IDE to run projects created on a PC, however anything that is a standard opensource git/sourceforge/etc project should be fair game. Do the following to compile (appologies if you already know this):

1) download your source from git/sourceforge/etc
2) uncompress into your source directory (eg ~/src)
3) go to the extracted source directory (eg ~/src/ffmpeg/)
4) if there is a configure file, run ./configure
5) if there isn't a config file, but there is an autogen.sh, run it
6) if there are automake files, well you get the idea.
7) install any missing libraries reported by one of the configure methods (remember to install the -devel version) -> repeat 4)
8) tweak the parameters to the build (do ./configure -h to see a list of options)

When you are ready to compile, run:

make -j 9

which uses 9 concurrent compiles - this speeds up the compile time. You can use make -j 10, but I like to leave one processor free for phone stuff.

Now comes the fun part: fix any bugs that occur during build. When the program compiles, you can run it and see what works/doesn't. Modify parts that don't work till you are happy


To make an RPM, create a tIDE project and modify the qml to your liking. I made a button which calls python code which runs a process (your app). When you are happy, modify the file in the project named <yourproject>.spec to add your own bits (eg copy the executable), and use the pulley menu "Build Project".

Done

defunked

  • Newbie
  • *
  • Posts: 24
    • View Profile
USB Ethernet adapter use
« Reply #9 on: September 09, 2018, 06:10:56 pm »
Quote from: vader
To make an RPM, create a tIDE project and modify the qml to your liking. I made a button which calls python code which runs a process (your app). When you are happy, modify the file in the project named <yourproject>.spec to add your own bits (eg copy the executable), and use the pulley menu "Build Project".

Done

I have the sailfish cppqml example (from git) in a code directory on my Gemini, and can open the source files and such using tIDEedit.  I found and opened the .spec file in the RPM sub-directory, but I can't find the "Build Project" pulley menu in tIDE, even when the .spec file is open.  It also looks like the .pro file in the project top level directory is the one I should really be editing to customize the build, not the .spec file. I am lost as to how the build process is supposed to work.  No make files or auto build style scripts seem to exist in the project.  

What am I missing?