[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
HOWTO: installing telnetd &apps from USB via PC w/o internal disk
04-04-2009, 11:38 PM (This post was last modified: 04-04-2009 11:58 PM by java.lang.)
Post: #1
HOWTO: installing telnetd &apps from USB via PC w/o internal disk
Hi forum,
this is my first post, first thank you all for your work and statements I've seen so far.
I've developed a small utility (service-installer:"sinst.cgi") which I'd like to share, maybe some of you can use it too. But don't forget: USE IT AT YOUR OWN RISK.

have fun, regards, java.lang

features of sinst.cgi
  • installs and starts a predefined list of services from USB-stick or drive to /tmp (ftp and telnet per default)
  • remaps the ftpuser to the mounting point (thx to lundman)
  • maps vi and more to /bin
  • startable from WEB browser or wget command
download
I didn't find a possibility to put an attachment in this forum, so shorterhand I'll provide it from one of my pages, don't be confused, it has nothing to do with flexcontrols, go to the download section.
flexcontrols


background
The goal was to make my home environment a bit more maintainable, I have two A110 (without internal drives) located in different rooms, the data is coming from a NAS. So the question was, how to control the NMT's from another location (telnet, starting, stopping, running apps etc.) without the need of walking to each room, searching the remote and so on. An internal drive for the poppis is out of discussion due the lack of spin-down and the noise especially for using in the sleeping room.
problem
Telnet and ftp and much other services are not enabled in A110 w/o internal drive. Using the method 'Running from USB stick" from lundman is primary very useful but has the lack of visiting each NMT-room whenever a poppi was switched off and something has to be maintained.
solution
Installing telnetd, ftpd or other apps controlled from a WEB browser or from a unix command line or script through the open port 8883.
preconditions

  1. add following line in your /etc/hosts (..system32/drivers/etc/hosts on Windows): "NMT_IP localhost.drives", where NMT_IP is the IP of the poppi (10.0.0.105) in following example:
    Code:
    10.0.0.105     localhost.drives
  2. provide an USB stick with the installer-files on the root level of the stick. Push the stick into the NMT, power ON. Example of the provided sinst.list for installing telnet- and ftpserver:
    Code:
    busybox26
    run_once.sh
    ftpserver.sh
    nmt_services.cgi
    pure-ftpd
    pure-pw
    *"busybox26" AND "run_once.sh" are mandatory!

run
Now go to the web browser and enter following line (adapt USB_DRIVE_X-X if your data comes from another slot)
Code:
http://localhost.drives:8883/USB_DRIVE_A-1/sinst.cgi
Alternatively on unix you can execute a wget command
Code:
wget http://localhost.drives:8883/USB_DRIVE_A-1/sinst.cgi
After at least one minute since this input ftp and telnet services are running.
remarks
Optional: edit "sinst.lst" for adding/removing files.
Find all posts by this user
04-18-2009, 11:18 AM
Post: #2
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
When I input : http://localhost.drives:8883/USB_DRIVE_A-1/sinst.cgi I get a blank white screen in IE and Firefox.

What am I doing Wrong? I am sure its drive A-1
Find all posts by this user
04-20-2009, 07:30 AM
Post: #3
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
(04-18-2009 11:18 AM)shenouda Wrote:  When I input : http://localhost.drives:8883/USB_DRIVE_A-1/sinst.cgi I get a blank white screen in IE and Firefox.

What am I doing Wrong? I am sure its drive A-1
hmm...seems to be a malfunction in executing one of the shell commands...if there is an error (for what reason ever), the response stream is killed and you get the effect of a blank line...

my suggestion to resolve your problem:
0)Check your blank page with "display source" in your browser. Maybe you'll see an incomplete html fragment and/or error message.
1)remove all shell commands from the sinst.cgi and just return a plain html page. If this works, the addressing and port setting are OK, goto 2). Otherwise check this.
Code:
#!/bin/sh
echo "Content-Type: text/html"
echo ""
echo ""
echo "<html><head><title>popcorn-hour-service-installer</title></head><h2>*** SINST ***</h2><body>installing services from $INST_SRC_DIR to /tmp...done<br>"
echo "</body></html>"
exit 0
2)Insert shell commands step by step removed in 1) to see where the failure happens.

Good luck,
java.lang
PS:in my environment both browsers are working correctly
Find all posts by this user
05-15-2009, 07:24 PM
Post: #4
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
oh!
Ive just got "Requested file not exist! (404 Not Found)" in my webbrowser.

And when I started the cgi-file in my NMT I got error to.

Someone maybe can help me?
Find all posts by this user
08-01-2009, 11:20 AM
Post: #5
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
It wouldn't run for me, as with some of the other posters.

The files sinst.cgi, run_once.sh and ftpserver.sh in sinst.zip have DOS line endings not Unix ones, and the the busybox shell doesn't like them.

I fixed them and then it all worked.

Perhaps java.lang could sort it out and upload a new version of sinst.zip.

In the mean time, if you want to fix the files yourself you can use dos2unix. This usually comes with Linux, but for Windows there is a version available at http://www.bastet.com/. I haven't tried that myself: I used gvim under Windows to convert the files.
Find all posts by this user
09-07-2009, 08:48 PM
Post: #6
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
(08-01-2009 11:20 AM)unixer Wrote:  It wouldn't run for me, as with some of the other posters.

The files sinst.cgi, run_once.sh and ftpserver.sh in sinst.zip have DOS line endings not Unix ones, and the the busybox shell doesn't like them.

I fixed them and then it all worked.

Perhaps java.lang could sort it out and upload a new version of sinst.zip.

In the mean time, if you want to fix the files yourself you can use dos2unix. This usually comes with Linux, but for Windows there is a version available at http://www.bastet.com/. I haven't tried that myself: I used gvim under Windows to convert the files.

If your on OS X or some other unix'y OS with out a dos2unix, you can use "tr" utility.

cat $1 | tr -d '\r'

PCH A-100, A-110 & A-200

Find all posts by this user
09-07-2009, 10:25 PM
Post: #7
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
(08-01-2009 11:20 AM)unixer Wrote:  In the mean time, if you want to fix the files yourself you can use dos2unix. This usually comes with Linux, but for Windows there is a version available at http://www.bastet.com/. I haven't tried that myself: I used gvim under Windows to convert the files.

Or using Notepad++ like we recommend for editing Linux files, using menu option "Format --> Convert to UNIX"

I never saw this thread before, and although I am sure it works, I still don't see how
java_lang controls *both* of his PCH units because he modifies his
.../system32/drivers/etc/hosts on Windows for one PCH only,
and this can't be done for both, unless he has a second PC and modifies that
for the second PCH to point to localhost.drives
Find all posts by this user
09-07-2009, 11:10 PM
Post: #8
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
(09-07-2009 10:25 PM)garp99 Wrote:  Or using Notepad++ like we recommend for editing Linux files, using menu option "Format --> Convert to UNIX"

I never saw this thread before, and although I am sure it works, I still don't see how
java_lang controls *both* of his PCH units because he modifies his
.../system32/drivers/etc/hosts on Windows for one PCH only,
and this can't be done for both, unless he has a second PC and modifies that
for the second PCH to point to localhost.drives


Or maybe he modifies hosts to point to the other nmt and loads the same url.

After the nmt is booted and running, you use telnet to control them.

PCH A-100, A-110 & A-200

Find all posts by this user
09-22-2009, 05:40 PM (This post was last modified: 09-22-2009 05:58 PM by Zerebro.)
Post: #9
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
Confirmed that sinst.cgi was in DOS format, had to convert to UNIX to make it work.

Thanks for that anyway! I had to reinstall NMT Community apps but wasn't able to get to the root.

But...

Even though I got this on running the cgi:
PHP Code:
*** SINST ***
installing services from /opt/sybhttpd/localhost.drives/USB_DRIVE_A-1 to /tmp...
...
busybox26
...run_once.sh
...nmt_services.cgi
...pure-pw
map vi
,more for direct use...
ln: /bin/viFile exists ln: /bin/moreFile exists saving and assigning a temporary crontab to run once...
!!!
be patientservices are running at least in one minute since now!!!
SINST done 

I wasn't able to telnet (with Putty) to my HDX-1000, even after 5 minutes of waiting. When I try I get 'Connection closed by remote host'.

Any clue to find my problem? I'm out of suggestions
Find all posts by this user
09-22-2009, 08:38 PM
Post: #10
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
@ZEREBRO

I just needed telnet for my own, started the whole procedure, and I can confirm: your output is exactly the same than mine I've got on the browser, everything seems OK so far.

Maybe you are connecting with SSH, be sure to connect with pure telnet. In case you are using putty, be sure the radiobutton "telnet" is checked (and not "SSH"-which is the default selection-), otherwise you'll get the error "connection refused".

hope this helps,
regards
java.lang
Find all posts by this user
09-22-2009, 08:41 PM
Post: #11
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
Thanks for the answer, I used the default port for telnet (port 23).

Anyway, I got a HD so I have an option there too.
This worked for me, but I can't stand this didn't work, in case I removed the HD of my NMT.

Cheers,
-Z-
Find all posts by this user
09-22-2009, 09:18 PM (This post was last modified: 09-22-2009 10:42 PM by java.lang.)
Post: #12
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
@garp99: you are right, controlling both nmts at the same time with one PC and one entry in the hosts cannot be done...either changing the hosts or the PC or virtual machine will succeed (as xor commented).

@xor: I've just checked the sinst.zip...all three files you mentioned ARE with unix-lineendings on the server. I think, if someone extract this on a windows PC, the CR-ending is automatically converted to CR/LF through winzip or windows respectively.
Conclusion: editing the three files should be done on unix side i.e by using vi, or, if done on the windows side, one of the tools must be used to convert the endings back.
@ ZEREBRO:
I've overseen the line:
Quote:ln: /bin/vi: File exists ln: /bin/more: File exists saving and assigning a temporary crontab to run once...

This states, that your script was already run before. Nevertheless, you should be able to gain access to the nmt.

After a rebooting the following output should appear:
PHP Code:
*** SINST ***
installing services from /opt/sybhttpd/localhost.drives/USB_DRIVE_A-1 to /tmp...
...
busybox26 
...run_once.sh 
...ftpserver.sh 
...nmt_services.cgi 
...pure-ftpd 
...pure-pw 
map vi
,more for direct use...
saving and assigning a temporary crontab to run once...
!!!
be patientservices are running at least in one minute since now!!!
SINST done 

So, because there is no magic in the script and you see no error between the first and last line
PHP Code:
echo "saving and assigning a temporary crontab to run once...<br>"
crontab -l>/tmp/ct_save
echo "*/1 * * * * /tmp/run_once.sh">/tmp/crontabs_tmp
chmod 755 
/tmp/crontabs_tmp
crontab 
-d
crontab 
/tmp/crontabs_tmp
echo "!!!be patient, services are running at least in one minute since now!!!<br>SINST done" 
the only thing I can imagine at the moment is, that you're not using the right IP-address. Did you verify the IP with ping? Have you tried the whole with a reboot?

[/php]
Find all posts by this user
09-23-2009, 09:44 AM (This post was last modified: 09-23-2009 09:45 AM by tasujad.)
Post: #13
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
Morning,

Has anyone smarter (then dumb ol' me) tired this with new c200?

will it work or is the architecture different?

C200(1080p/60Hz)-HDMI-Philips 42PFL7662/D12
C200-Coax-(Straight input decoding)Yamaha RX-V461
internet-Router(buffalo wifi)-Ethernet 10/100-C200(manual IP)
Find all posts by this user
09-23-2009, 09:49 AM
Post: #14
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
Hi,

Yes, tried reboot and I've quadriple checked the IP-address Smile
I blame HDX-1000 with their new firmware. Also have odd problems with CSI.

Thanks anyway for replying!
-Z-
Find all posts by this user
12-27-2009, 06:39 PM
Post: #15
RE: HOWTO: installing telnetd &apps from USB via PC w/o internal disk
Hello, Thanks for the files.
My problem is that I don't have the IP adress of my poppi.
As soon as I disable my Harddrive with the programs from the Poppi, I can't access my A110 via another computer. Please help and support.

Thanks, rastin
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  NMT & CSI apps on USB, media on NTFS SATA, transmission downloads to SATA mmartine 8 4,384 03-23-2013 06:46 AM
Last Post: jve
  HOW TO: The NMT Apps drive, NTFS for data, the CSI/iPkg apps, on one drive nuke12 49 23,110 12-16-2012 01:50 PM
Last Post: smithyboy
Wink [HOW-TO] NMT Apps and CSI apps on USB Drive with SATA Drive Artifex14 8 10,008 03-15-2012 01:47 PM
Last Post: mmartine
  How to Align “Advanced Format”, 4096 byte/sector Drives for use as the NMT Apps Drive nuke12 43 21,055 03-05-2012 08:58 PM
Last Post: ramborules
  How-To: Transfer files via USB slave from PC to NMT chris57 157 178,255 02-11-2012 10:03 AM
Last Post: minazza
  [HOWTO] Ralink RT2870 wifi chipset artbern 8 11,270 02-04-2012 09:13 PM
Last Post: anilech
  HOWTO: Windows 7 ext2/3 support - update? Minok 6 9,714 12-25-2011 09:37 PM
Last Post: newmediawhisperer
  HOWTO: Mount NMT share on Windows Mobile mkkm 0 2,695 12-25-2010 02:53 PM
Last Post: mkkm
  Howto: Updated - Get mythtv playback nice and pretty WORKING! tivo1 1 3,221 08-29-2010 08:40 AM
Last Post: tivo1
  HOWTO: Windows 7 ext2/3 support [USB-Slave] DeliriumNL 35 197,560 02-21-2010 12:57 AM
Last Post: maxyvan98

Forum Jump: