OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> USB Ethernet adapter use
defunked
post Sep 1 2018, 07:55 AM
Post #1





Group: Members
Posts: 24
Joined: 21-July 18
Member No.: 826,576



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?
Go to the top of the page
 
+Quote Post
depscribe
post Sep 1 2018, 09:04 PM
Post #2





Group: Members
Posts: 255
Joined: 3-January 18
Member No.: 815,753



QUOTE(defunked @ Sep 1 2018, 07:55 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?

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.
Go to the top of the page
 
+Quote Post
depscribe
post Sep 3 2018, 10:21 AM
Post #3





Group: Members
Posts: 255
Joined: 3-January 18
Member No.: 815,753



QUOTE(defunked @ Sep 1 2018, 07:55 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?

Just to make sure: you've gone to Settings > Developer mode > Networking and noted what you found there?
Go to the top of the page
 
+Quote Post
defunked
post Sep 3 2018, 11:27 AM
Post #4





Group: Members
Posts: 24
Joined: 21-July 18
Member No.: 826,576



QUOTE(depscribe @ Sep 3 2018, 11:21 AM) *
QUOTE(defunked @ Sep 1 2018, 07:55 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?

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.
Go to the top of the page
 
+Quote Post
vader
post Sep 3 2018, 01:12 PM
Post #5





Group: Members
Posts: 253
Joined: 21-January 18
Member No.: 816,775



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.
Go to the top of the page
 
+Quote Post
defunked
post Sep 3 2018, 02:22 PM
Post #6





Group: Members
Posts: 24
Joined: 21-July 18
Member No.: 826,576



QUOTE(vader @ Sep 3 2018, 02:12 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.


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.
Go to the top of the page
 
+Quote Post
vader
post Sep 3 2018, 05:04 PM
Post #7





Group: Members
Posts: 253
Joined: 21-January 18
Member No.: 816,775



QUOTE(defunked @ Sep 4 2018, 08:22 AM) *
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.
Go to the top of the page
 
+Quote Post
defunked
post Sep 4 2018, 07:27 AM
Post #8





Group: Members
Posts: 24
Joined: 21-July 18
Member No.: 826,576



QUOTE(vader @ Sep 3 2018, 06:04 PM) *
QUOTE(defunked @ Sep 4 2018, 08:22 AM) *
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.
Go to the top of the page
 
+Quote Post
vader
post Sep 4 2018, 05:07 PM
Post #9





Group: Members
Posts: 253
Joined: 21-January 18
Member No.: 816,775



QUOTE(defunked @ Sep 5 2018, 01:27 AM) *
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 smile.gif


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 smile.gif
Go to the top of the page
 
+Quote Post
defunked
post Sep 9 2018, 02:10 PM
Post #10





Group: Members
Posts: 24
Joined: 21-July 18
Member No.: 826,576



QUOTE(vader @ Sep 4 2018, 06:07 PM) *
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 smile.gif


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?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2019 - 05:28 PM