Go Down

Topic: [SOLVED]Getting rid of unused processes (Read 1 time) previous topic - next topic

Wuerfel_21

May 19, 2015, 10:37 pm Last Edit: May 21, 2015, 07:40 am by Wuerfel_21
Hi,

I bought a Yun a year or so ago, but didnt use it...
I remember the AVR on it being utter crap, so all the processing has to happen on the MIPS side, which(i don't have the yun here currently) probably is riddled with background processes of all sorts, like http servers, the thing that remotly programs the AVR, that python program that interfaces with the serial port(which i'll be using myself...) and all that stuff.

So is there any way of having just the kernel, drivers and my application(and probably things like the wifi deamon or the network time thing(i dont belive the yun has a battery backed clock) (EDIT: And a the SSH server might be useful aswelll)) run?

Also im a bit in fear of the factory reset button, can you disable that feature, or change the image it uses?

jessemonroy650

#1
May 20, 2015, 01:47 am Last Edit: May 20, 2015, 01:49 am by jessemonroy650
Hi,

I bought a Yun a year or so ago, but didnt use it...
I remember the AVR on it being utter crap, so all the processing has to happen on the MIPS side, which(i don't have the yun here currently) probably is riddled with background processes of all sorts, like http servers, the thing that remotly programs the AVR, that python program that interfaces with the serial port(which i'll be using myself...) and all that stuff.

So is there any way of having just the kernel, drivers and my application(and probably things like the wifi deamon or the network time thing(i dont belive the yun has a battery backed clock) (EDIT: And a the SSH server might be useful aswelll)) run?

Also im a bit in fear of the factory reset button, can you disable that feature, or change the image it uses?
@Wuerfel_21,

I have just posted my NOTES on Processes Running After Boot Up. This along with my NOTES on the Yun rcS (boot) process should get you moving in the right direction.

If you want to reduce the modules running with the kernel you can stop them at boot time (See  Yun rcS (boot) process) After that SonnyYu should be able to help you to compile a new kernel, if needed.

As for the factory reset button, ShapeShifter has notes on that and should be able to help you get the button disabled.

Jesse

Wuerfel_21

Thanks for the info!

The Yun schematic makes me belive that the HANDSHAKE signal from the MIPS goes onto pin 7. Is that true? Could the SPI driver be told to use that as its SS line?
Then i could use spi peripherals from linux without having to use the AVR as a bridge. Would that work?

ShapeShifter

As for the factory reset button, ShapeShifter has notes on that and should be able to help you get the button disabled.
Wow, performance pressure!  :o

Actually, any notes I have came from you, Jesse. I'm surprised you didn't take this one as it's clearly a Linux configuration task.  ;)

I'm not sure what's the best place to disable it, but breaking any step in this chain should stop the button from working:
  • /etc/rc.d/S93triggerhappy starts the triggerhappy process to look for button presses
  • /etc/triggerhappy/triggers.d/reset.conf defines the actions to be performed when when the button is pressed and released
  • /usr/bin/wifi-reset-button-pressed is run when the button is pressed. It basically records the time that the button pressed happened.
  • /usr/bin/wifi-reset-button-released is run when the button is released. It looks at the time when the button was pressed, compares it with the current time, and figures out how long the button was held down. If more than 28 seconds it calls reset-to-factory-anyway and reboots, otherwise if more than 3 seconds it calls wifi-reset-and-reboot.
  • /usr/bin/reset-to-ractory-anyway calls the Linux commands to reset the file system back to factory defaults.
  • /usr/bin/wifi-reset-and-reboot reconfigures the WiFi interface into the default access point mode and reboots.

ShapeShifter

Yes, the handshake line goes between the two processors. It is normally disabled on both ends. On the Linux side, it is GP19, and it passes through the level shifter U7 which is controlled by GP22. That level shifter must be enabled before the signal will go through. I've not tried to use it as an SPI CS line, but I have used it as GPIO to signal the '32U4 processor that booting is complete. To do so, I've added this code to my /etc/rc.local file:
Code: [Select]
# Added section to set the handshake line.
# GP19 is connected to D7 of the 32U4 processor.
# This requires setting GP22 high to enable the U7 level shifter.
# This GPIO is already exported.
# Then GP19 needs to be exported, set to output, and finally brought low.
echo 1 > /sys/class/gpio/gpio22/value
echo 19 > /sys/class/gpio/export
echo "high" > /sys/class/gpio/gpio19/direction
echo 0 > /sys/class/gpio/gpio19/value

At that point, I could have my sketch set pin 7 to be an input (with pullup) and then read the state of the line: if not booted, the pullup will cause it to read high, once booted the script above sets the pin low.

To do what you want, you need to make sure pin 7 of the '32U4 processor is an input so it doesn't interfere with the signal. Then you need to turn on GP22 to enable the shifter. Finally, you need to figure out how to use GP19 as a CS signal (you may have to manually control it?)

Wuerfel_21

Does Triggerhappy service any other buttons? if not, i could get rid of it completly, freeing up some memory.(Thw wifi reset is kinda pointless, it just sets the wifi to an unencrypted acces point).

Also, is the SPI driver on the yun a generic one or was it specifically made for the yun?

ShapeShifter

Does Triggerhappy service any other buttons?
It processes whatever is in any of the configuration files in /etc/triggerhappy/triggers.d/ which on a default Yun is:
  • example.conf - an example file with comments but no button definitions
  • reset.conf - a file that defines the press and release actions for the YUN RST button

If your system is the same and you have no other buttons configured, then I guess it should be safe to disable triggerhappy.

Quote
Also, is the SPI driver on the yun a generic one or was it specifically made for the yun?
I have no idea, never used it.

jessemonroy650

Wow, performance pressure!  :o

Actually, any notes I have came from you, Jesse. I'm surprised you didn't take this one as it's clearly a Linux configuration task.  ;)

::::SNIP::::

@ShapeShifter,

I thought I saw you posting something about rc.local on this?

Jesse

jessemonroy650

Does Triggerhappy service any other buttons? if not, i could get rid of it completly, freeing up some memory.(Thw wifi reset is kinda pointless, it just sets the wifi to an unencrypted acces point).

:::SNIP::::
@Wuerfel_21,
from the notes I have, this appears that this is all that triggerhappy does. It has been used in some example tutorials I have seen, but I have no notes that indicate that triggerhappy is used for anything else.

NOTE: one of the example I have seen uses it as a deadman/watchdog.

Jesse

Wuerfel_21

Thanks for the info about processes!

I will open another thread about spi ss on pin 7, to keep everything nice and organized.

jessemonroy650

Thanks for the info about processes!

I will open another thread about spi ss on pin 7, to keep everything nice and organized.
@Wuerfel_21,

Could you append [SOLVED] to your Subject line, this will help people in the future with similar issues.

TIA
Jesse

Go Up