ETC as running ftp or ssh instead of webserver


#7

See https://wiki.archlinux.org/index.php/NFS
You create /etc/exports and add the path which shall be exported (in this case /usbdrive)
Then you start the nfs-server (systemctl nfs-server.service enable or start)
On the Mac side it is simply adding a remote filesystem

For Windows you’d need a Samba server (https://wiki.archlinux.org/index.php/Samba)

I did not do it with arch linux yet, but in other unixes I did this a thousand times. I am not sure how much these services would affect the memory usage. It won’t be much, but for sure it will.


#8

BTW: I found that sometimes the python process hangs in this network configuration. It happens about two or three seconds after the first Mode started. While these few seconds I can use the knobs and buttons, but after that the screen freezes and the buttons do no longer react. The linux itself is running fine.

It does not always but it happens.

I added stdout and stderr redirection to the start command in /root/ETC_Sys/scripts/start-etc.sh like
echo "#################date############" >> /tmp/etc.log
python2 main.py >> /tmp/etc.log 2>&1 &
But the output is quite poor

#################Sat Oct 17 01:07:27 UTC 2015############
Failed to symlink /root/.config/pulse/0ad93370e24141368e4ae814b5796c88-runtime.tmp to /tmp/pulse-PKdhtXMmr18n: Read-only file system
Failed to symlink /root/.config/pulse/0ad93370e24141368e4ae814b5796c88-runtime.tmp: Read-only file system
libpng warning: iCCP: known incorrect sRGB profile

dmesg doesn’t report anything unusual.

Do we have any other possibility to see, what python is doing here? Do truss / tusc / strace / trace exist in arch linux?


#9

is python crashing? (i.e. is the python process still running after its freezing?)

you could install strace via pacman

I actually quite like the web editor, the only thing i dont like is the left hand pane, where the files and save options are… I think the save options, probably should be buttons at the top, so they are always available without having to scroll thru the whole mode list.

I think when I get time I might take at look at improving the editor, as its pretty sound otherwise, and the workflow when developing modes is really fast :slight_smile:

btw… if you do want to edit remotely, you’ll also want to look at the osc messages that is used to tell ETC/python that the file has change, and so to reload the mode… you can find this either in the web editor code, or osc.py.
(sorry cant remember the message off-hand)

btw… if your going down the route of remote editing , Id also recommend switching to using the sdcard for storing modes, see my organelle post on this… this only requires a very small change in etc_system.py, my experience is the sdcard is much more reliable than usbsticks.
(and frees up the usb ports for midi controller(s) without needing to carry around a usb hub as well :wink: )


#10

The process still exists, but it needs a kill -9. I can’t say whether it hangs in a loop or is really stuck. That is, why I’d like to strace it.

Btw: I have the same opinions on the webbased editor (if you ever move the save buttons to the top, then please also make the sort order alphabetical). My goal is not to replace the editor, but I mostly want to handle image files or fonts and also organizing modes (adding / removing / renaming …) is much easier with a usual filesystem access.


#11

hmm, and its not animating still? or just not responding to controls?
if its not animating, probably an issue with pygame - perhaps blocked in its main loop.
if it just not responding to controls it could be the etc daemon process has crashed (this routes from the micro controller to python via osc)

as you say, hard to know without more info… anyway strace should be installable, it is on my organelle.
(sorry i dont have an ETC to test with so cant look into the real cause, as it’ll be different on the organelle/otc)

web editor, yeah agreed…
what I do when i want to organise things (or do quick edits ;)) is log in via SSH and then do them directly on the box - its faster for me, than using remote filesystems etc.
… also means I can restart processes where necessary, which you sometimes have to do as ETC caches things in memory.


#12

It is not animating. So it looks like the pygame is blocked.

I will install strace as next step. (I hope I won’t destroy the linux installation :wink: )

Yepp. I recognized that too. I made an mistake in programming, corrected it, but the behaviour stayed the same. I found that it helps, if I remove the pyc file, befor I save the Mode. It looks like python refills its caches when it compiles.


#13

Hi

I just wanted let you know the solution for the hang:
I found that it is not wise to start the Network client (dhcpcd in the example given by @oweno above), while python is running already.
So I moved the WiFi initialisation in /root/ETC_Sys/scripts/setup.sh in front of the start-etc.sh:

It is nowlike this:

        export SDL_VIDEODRIVER=fbcon

        #etc-start moved after Wifi.sh
        #/root/ETC_Sys/scripts/start-etc.sh

        # try to start wifi if there is a config file
        # and start the web interface
        if [ -f /usbdrive/WiFi.sh ]; then
                echo "wifi usb adapter found"
                /usbdrive/WiFi.sh
        fi
        pause 1

        /root/ETC_Sys/scripts/start-etc.sh

        if [ -f /usbdrive/WiFi.sh ]; then
                cd /root/ETC_Web
                ./run.sh &
        fi

#14

interesting… thanks for sharing this fix!


#15

I am happy that I can help to make this nice product even better.

I found that out, when I replaced python2 main.py in start-etc.sh by strace -o /tmp/strace_etc.out.txt python2 main.py. This causes python to run much slower.
With this “slowed down version” of python, the problem did not appear.

My interpretation is, that there is a kind of Xserver running, to which the display of python is sent. If we change the network setting we change in consequence maybe also the $DISPLAY setting (if I had the on screen display activated I still saw the 127.0.0.1 though I could access the ETC under its 192.168… address) Python might not like it, that the IP / display variable change happens while it is trying to write one of the 30 frames.
With the move of the WLAN startup the new $DISPLAY variable is already set, when python starts.

Best regards
Florian


#16

Hi

I did this change. It is dead easy:

edit /root/ETC_Web/static/index.html
search for “body>”

change the body-content. It should look like this:

  <body>
    <div id="menu" >
      <a class="side-button" href="index.html">Editor</a> &nbsp;&nbsp; | &nbsp;&nbsp; 
      <a class="side-button" href="grabs.html">Screen Grabs</a>
    </div>

    <h1 id="title"></h1>

    <div id="reload-mode" class="side-button"> reload </div>
    <div id="save" class="side-button"> save </div>
    <div id="save-new" class="side-button"> save new </div>
    <br />

    <div id="modees"> </div>
    <br /> <br /><br /> <br />

    <div id="editor"> import cool </div>

    <script>
    </script>

    <div class="modal"><!-- Place at bottom of page --></div>

    </body>

Before the edit the three div-sections reload, save, save new where below of the modes section.


#17

I’m reviving this old topic, because I can’t seem to enable the SSH server. I’m running the 0-WebFiles mode, and the “Organelle Patches” (LOL) web server runs fine, but SSH seems to still be off, giving me “connection refused”.

Is the sshd set to a different port by default?

Also, there is a mention in this thread of using a keyboard to drop to command-line. How do I do this?


#18

It is standard port 22

I don’t have the ETC here, but I may have a look at the configuration when I am at home.


#19

Thanks, it seems dead to me. I’ll try some more, it would really help if I could develop over SSH instead, using Atom as an editor… :slight_smile:


#20

SSH is disabled by default on ETC. but you can use this mode which will enable it when you restart:

import os
import pygame

def setup(screen, etc) :
    os.system("systemctl enable sshd")
    os.system("systemctl start sshd")

def draw(screen, etc) :
    pass

#21

Thanks! The start command was missing from the 0-WebFiles installation package. I’m in now. :slight_smile:


#22

There is another problem with the instructions in this thread, is it possible that the wifi adapter now shipping with the ETC requires a different driver?

The line “wpa_supplicant -B -D nl80211,wext -i wlan0 -c <(wpa_passphrase “NETWORK_NAME” “PASSWORD”)”

returns

“nl80211: Could not configure driver mode”

on my ETC. Prodding the system tells me that I have the rt2870 chip in the USB wifi dongle that came with my ETC. What driver should I use instead?


Accessing filesystem and printing script output
#23

More exactly, lsusb returns:

Bus 001 Device 002: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter


#24

FYI: Solved this by messing around with the system, following the official Arch instructions: https://wiki.archlinux.org/index.php/WPA_supplicant

Now I’ve got it set up in wpa_supplicant.conf instead, and it works as it should without specifying driver.


#25

Thats good to hear.
What are your exact settings in /etc/wpa_supplicant/wpa_supplicant.conf now?

Do you run the ETC as master of its own network or do you use it as a client in your local home WLAN?
(I found the latter more practical)


#26

I’m connecting to my home WLAN, that was the whole point, otherwise the WiFi.sh method was working for me, to set up ETC’s own network.

The wpa_supplicant.conf is now just:

update_config=1
    
network={
ssid="MY_NETWORK"
psk="MY_PASSWORD"
}

I set it up by following the instructions for wpa_cli here: https://wiki.archlinux.org/index.php/WPA_supplicant

My WiFi.sh file now just contains the line “dhchcd” to start DHCP.