odroid_C1 - boot into console mode + switch off ethernet

Post Reply
sbigler
Posts: 41
Joined: Thu Jul 31, 2014 10:53 pm
languages_spoken: english
ODROIDs: odroid-u3 / odroid-c1 / odroid-c1+
Has thanked: 0
Been thanked: 0
Contact:

odroid_C1 - boot into console mode + switch off ethernet

Unread post by sbigler » Sat Apr 20, 2019 1:08 am

Hi,
I built a specific ncurses application that manages/drives stepper motor, hall sensor, led, switch, etc... Everything was developed/compiled directly on the C1 (Ubuntu 14.04.6 LTS) and works as expected. :)

Now I would like to configure the system to make it usable straightforward to the end user. Especially preventing him typing too many commands before starting the final application. :mrgreen:
Do you guys know how to:
  • boot the C1 directly into console mode (like CTRL+ALT+F1)
  • switch off internet service
  • start automatically a compiled bin file

Any hints would be really appreciate.
Thx,
Stephane
Last edited by sbigler on Wed Jun 12, 2019 11:35 pm, edited 2 times in total.

Nuems
Posts: 117
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by Nuems » Mon Apr 22, 2019 5:18 am

If you don't need a desktop environment, you could use a minimal Debian image as a starting point. It boots to the login prompt unless you configure it to do something else (see below). However, if you want to stick to an Ubuntu version that's unmaintained as of this month, I guess it's enough to disable the upstart script for the display manager - not sure which one was used back then.

In order to "switch off the internet service", well, maybe you should be more specific. Do you want LAN access? If you don't, pull out the cable ;)
However, if you need LAN access, there are several ways of achieving that goal. It's also a question of security needs. A simple local hack would be to configure ethernet settings manually in /etc/network/interfaces without setting a gateway. Your odroid will "know" the local subnet, but it won't "know" how to leave it. However, anyone with physical access to your device could change that by simply taking out the sd-card/emmc for editing those settings on another computer. I guess it's better to block internet access for the odroid on your local router.

Starting an executable file automatically can be done in various ways - for example:
  • create a systemd job - or, on Ubuntu 14.04, I guess it should be an upstart job
  • write a tradional init script
  • start your executable via /etc/rc.local
I'm aware this isn't a full how-to, but I hope I've provided some clues that help you research a solution that fits your needs.

Edit: If you want to prevent any network access and not providing an ethernet cable isn't secure enough, you could:
a) compile your own kernel without support for the c1's network
b) spend $28 on an Odroid C0 - it doesn't have an RJ45 socket.

sbigler
Posts: 41
Joined: Thu Jul 31, 2014 10:53 pm
languages_spoken: english
ODROIDs: odroid-u3 / odroid-c1 / odroid-c1+
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by sbigler » Tue Apr 23, 2019 1:51 am

Thx Nuems for your valuable answer.
1) I was not aware of Ubuntu 14.04 LTS being unmaintained. I should maybe upgrade to 16.04LTS...
2) the system communicates through LAN from time to time for many reasons (that I do not know). This prevents my stepper running smoothly (pulling out the cable will not change this behavior). This is why I wanna switch the ethernet OFF.

Having no experience at all in compiling kernel, I think I should better make an interface board that will manage the stepper instead of trying to drive it directly from the C1.

Nuems
Posts: 117
Joined: Thu Sep 19, 2013 3:50 am
languages_spoken: english, german
ODROIDs: xu, c1
Has thanked: 0
Been thanked: 1 time
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by Nuems » Tue Apr 23, 2019 5:13 am

Well, as I've said above: There's the Odroid C0 which isn't exactly pricy - parts for the interface board and your time for soldering (at however much you rate that) are probably more expensive.
Or possibly a raspberry Pi Zero _without_ wifi might suite your needs.

Regarding Ubuntu 14.04: It's a long term support (LTS) version that was released in April 2014. In the Ubuntu world, LTS means five years, so you won't get updates any longer.

User avatar
mad_ady
Posts: 6168
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 122 times
Been thanked: 85 times
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by mad_ady » Tue Apr 23, 2019 2:06 pm

For new projects you should consider 18.04 instead.
Regarding hickups in the stepper motors - as long as they happen with network disconnected, I'd say networking isn't the cause...

sbigler
Posts: 41
Joined: Thu Jul 31, 2014 10:53 pm
languages_spoken: english
ODROIDs: odroid-u3 / odroid-c1 / odroid-c1+
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by sbigler » Tue Apr 23, 2019 4:53 pm

Few more points:
- I do need LAN when developing. I wanna switch it off only when the end user runs the application.
- networking is not the only reason why steppers do not run smoothly. One among others is the mouse that needs to be disabled as well...

sbigler
Posts: 41
Joined: Thu Jul 31, 2014 10:53 pm
languages_spoken: english
ODROIDs: odroid-u3 / odroid-c1 / odroid-c1+
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by sbigler » Wed Jun 12, 2019 11:32 pm

I finally designed a small I2C slave interface that drives the stepper according to the commands/orders received from the Odroid through i2c.
That way, the Odroid keeps doing what it has to (mouse, gui, network, etc...) and the I2C interface acts as a "galvanic" separated thread. No more hick-ups: steppers run super smooth now.

User avatar
odroid
Site Admin
Posts: 31363
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 50 times
Been thanked: 184 times
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by odroid » Thu Jun 13, 2019 9:37 am

Glad to hear you made a nice solution.

Can you please tell me more about the I2C slave interface?
Is it a small MCU which can handle the step-motors independently?

sbigler
Posts: 41
Joined: Thu Jul 31, 2014 10:53 pm
languages_spoken: english
ODROIDs: odroid-u3 / odroid-c1 / odroid-c1+
Has thanked: 0
Been thanked: 0
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by sbigler » Fri Jun 14, 2019 1:33 am

yep the MCU handles the stepper independently.

The interface I made is simply a small MSP430F2012 programmed as the I2C slave. It is connected to a pololu DRV8825 stepper driver.
The Odroid_C1 is the I2C master, it sends orders to the slave. The slave drives the required pins of the 8825 according to the received order.

User avatar
odroid
Site Admin
Posts: 31363
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 50 times
Been thanked: 184 times
Contact:

Re: odroid_C1 - boot into console mode + switch off ethernet

Unread post by odroid » Fri Jun 14, 2019 12:29 pm

Thank you for sharing a nice and useful solution.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests