LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   how to established a Telnet Session in MCF5329 embedded linux bases microprocessor (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/how-to-established-a-telnet-session-in-mcf5329-embedded-linux-bases-microprocessor-894240/)

zawii87 07-28-2011 04:07 AM

how to established a Telnet Session in MCF5329 embedded linux bases microprocessor
 
Hello I am using cobra5329 embedded linux based cold fire microprocessor .

Any body have some experience in using this product.

I need to make some serial or TCP/IP communication with this device , for this I need to established a telnet session on the board .

this board comes with the coopertaive linux (colinux) one . Any body have some idea that how can one establised a telnet session on the board .

I wrote to the partner manufacture company of the board and they wrote me this procedure

"
In reply to your Service Request SR 1-771784262:

First of all, you need to make sure you have "Target System Configurationŕ[*] boot up with a tty and login (::respawn:-/sbin/getty -L console 0 screen) Enter your inittab startup line”enabled.

Secondly, Under "Character Devices" of the Linux kernel configuration menu you need to have "Unix98 PTY support" and "Legacy (BSD) PTY support" enabled.

Then you have to rebuild the kernel and root filesystem for those changes.

After your system booting up, you need to log in with:

User: root
Password: root

The last stop is to add a user for telnet session by using “adduser”command.

For instance:

$ adduser kevin
adduser: /home/kevin: Read-only file system
Changing password for kevin
New password:
Bad password: too many similar characters
Retype password:
Password for kevin changed by root
$

If everything is going well, you can now try to launch the telnet session.

You will get the output like mine:

Welcome to the LTIB Embedded Linux Environment


freescale login: kevin
Password:
login: can't chdir to home directory '/home/kevin'


BusyBox v1.11.2 () built-in shell (msh)
Enter 'help' for a list of built-in commands.

/proc/sys/vm/min_free_kbytes: cannot create
/proc/sys/vm/vfs_cache_pressure: cannot create
$

""

and i didnt get at all what they are trying to say Can any body please help me and explains my problem with more detail and in simplified manner

Thanks and waiting for the reply

paulsm4 07-29-2011 01:43 PM

The procedure for setting up "telnet" sounds good, and it sounds like you understood it correctly.

Unfortunately, it looks like you have some serious problems with the way you set up your filesystem:
Quote:

$ adduser kevin
adduser: /home/kevin: Read-only file system
Changing password for kevin
...

BusyBox v1.11.2 () built-in shell (msh)
Enter 'help' for a list of built-in commands.

/proc/sys/vm/min_free_kbytes: cannot create
/proc/sys/vm/vfs_cache_pressure: cannot create
...
Suggestion - contact your vendor again, and get advice for setting up your "/home" and "/proc" filesystems correctly. You really can't proceed with anything else - including telnet logins - until you get the filesystem configuration issues resolved.

theNbomr 07-29-2011 02:22 PM

It isn't at all clear what parts of your post are your own experience, and which are the instructions from your vendor. Are you able to login to your embedded system at all (ssh?). Are you sure it is actually running, and has a vaild IP? What have you actually tried, so far and what happened or didn't happen? (details, please).

--- rod.

zawii87 08-01-2011 07:56 AM

Cobra board have specific IP adress and I can check the Serial connectivity of my cobra board by pinging the board via hyper terminal of my PC.

I can log in to my Cobra console via serial port

When i type ssh here it says not found there is nothing ssh present on the board In fact If i type telnet then it asks for the host and port number, which means there is only telnet client available on the board but I want telnet server .

Now I dont know that how to create that Telnet server for further communication in cobra5329.

I simply want to perform TCP/IP communication with this board support package and there is no help given in the reference manual too regarding this.

theNbomr 08-01-2011 10:15 AM

Quote:

Originally Posted by zawii87 (Post 4430627)
Cobra board have specific IP adress and I can check the Serial connectivity of my cobra board by pinging the board via hyper terminal of my PC.

You are confused about the relationship between ping and serial communications. There is no ping, no IP or any other address associated with serial communications. It is by definition a two-peer network, each peer can send to the other, and the other peer is the sole destination.

Quote:

I can log in to my Cobra console via serial port
Okay, so you can log in; that is good. When you log in please run, and report here the result of the command:
Code:

/sbin/ifconfig
Also, please post the result of the following command:
Code:

ps -e l | grep sshd
This will determine whether you have a ssh daemon running on the host. If so, you should be able to use an ssh client to log in to the host, and this is the preferred way to login. Use an ssh client on your workstation.

Quote:

When i type ssh here it says not found there is nothing ssh present on the board In fact If i type telnet then it asks for the host and port number, which means there is only telnet client available on the board but I want telnet server .
Hard to tell where 'here' is, so therefore what is saying 'not found', so that isn't very helpful. Please be specific about what kind of host you are referring to. Don't forget that people on this forum can't see what you're doing and need specific information in order to help you. Supplying accurate detail is usually the difference between quick success and a protracted time-waster.

There is not enough evidence to conclude that there is no telnet server on your host. See above.

Quote:

Now I dont know that how to create that Telnet server for further communication in cobra5329.

I simply want to perform TCP/IP communication with this board support package and there is no help given in the reference manual too regarding this.
If you really must have a telnet server (assuming you don't already), you will have to perform the following:
  1. Download and build the source code for a telnet server
    You might not have to do this, if it is already installed but not enabled
  2. Install the telnet binaries on the target host
  3. Enable the telnet process in the inetd daemon.
  4. Restart the inetd daemon

Do you have any Linux experience? It sounds like not much. It is important to know how to phrase responses to you, so we can provide useful help. It is important for you to answer questions that are posed. People ask those questions because they need more information, and it serves your purpose to provide them with it.

You mention hyperterminal, which I believe is a Windows contrivance. Do you have a Linux client host to use for testing in this scenario? If so, what Linux distribution is it running? There are numerous tools on a Linux host which are useful for diagnostics and so on. You may require a Linux environment if you need to cross-build a telnet server.
If you have a major Linux distro, it probably has a working telnet client. You should use that client to try to connect to your board, using the IP you think you know it has (from 'ping').
Code:

telnet xxx.xxx.xxx.xxx
Replace the 'xxx's with the IP of your embedded target board.
What happens? Be specific & complete. Clearly describe what system is emitting the messages.

--- rod.

zawii87 08-03-2011 04:00 AM

The result of ifconfig appears like that

# ifconfig
eth0 Link encap:Ethernet HWaddr AC:DE:48:53:29:01
inet addr:192.168.4.33 Bcast:192.168.4.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:128 (128.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

And as far as Telnet is concerned when I type Telnet it shows me this output


# telnet
BusyBox v1.00 (2006.11.14-12:36+0000) multi-call binary

Usage: telnet HOST [PORT]


Which means that Telnet host is present on the Target board and I am not sure about the Telnet server at all .

I am using Host operating system as Windows XP with Coperative Linux (Colinux) the software that Comes with the target board, it uses the tool chain according to my specific colde fire processor and create the binary file for me which Later I need to download on my Board via tftp server .


When I try to telnet my target board Via the command prompt of my windows operating system then it shows me this error.

H:\>telnet 192.168.4.33
Connecting To 192.168.4.33...Could not open connection to the host, on port 23:
Connect failed

zawii87 08-03-2011 04:02 AM

And this is my first Experience with Linux So I don't have much Idea about the Linux related Commands.

theNbomr 08-03-2011 09:08 AM

Okay, so we've established that the embedded host has its network up and running. The telnet client is a completely separate element from the telnet server, and trying to run the client has no implications whatsoever about the state of the server.
Now we need to locate the telnetd binary, if it exists. On the embedded host, at a shell commandline:
Code:

find / -name "telnet*"
This might take quite a while, and you will probably get a lot of error messages about file & directory access restrictions unless you run this with root privileges. Post here, any and all output that contains the word 'telnet', especially 'telnetd'. Use copy & paste to your shell commandline to make sure you get it copied exactly as I've shown. Don't leave out or add anything.

Also, look in /etc/init.d, and report what directories are named something like 'init*'. This will help to define what style of startup and configuration system your embedded host uses. We will need that to locate the script(s) where the telnet server gets started.

Please report here the result of the command:
Code:

uname -a
Is there a reason you cannot use ssh instead of telnet? You seem to be avoiding this question.

I've just located the home page for Cooperative Linux, and there its first page says:
Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively. I think you are confused about what you are runnning. My interpretation of the above is that the vnedor has supplied you with a version of Linux that you can run on your Windows workstation, for the purpose of communicating with the embedded host(s). Is this what you think you have. Please clarify.

--- rod.

zawii87 08-04-2011 03:26 AM

I don't understand in which envioremmenr I need to check these test on my target board or on my colinux enviorement. on the terget board console via hyper terminal it didn't work at all and it says

# find / -name "telnet*"
find: not found
# help

Built-in commands:
-------------------
. : break cd continue eval exec exit export help login newgrp
read readonly set shift times trap umask wait



on the Colinux window it gives me this output :


colinux:~# find / -name "telnet*"
/etc/alternatives/telnet
/etc/alternatives/telnet.1.gz
/opt/emlix/cobra532x/include/arpa/telnet.h
/opt/emlix/cobra532x/romfs/bin/telnet
/usr/share/doc/telnet
/usr/share/man/man1/telnet.netkit.1.gz
/usr/share/man/man1/telnet.1.gz
/usr/bin/telnet.netkit
/usr/bin/telnet
/usr/include/arpa/telnet.h
/usr/lib/menu/telnet
/usr/lib/python2.3/telnetlib.py
/usr/lib/python2.3/telnetlib.pyc
/usr/lib/python2.3/telnetlib.pyo
/var/lib/dpkg/info/telnet.postinst
/var/lib/dpkg/info/telnet.list
/var/lib/dpkg/info/telnet.prerm
/var/lib/dpkg/info/telnet.postrm
/var/lib/dpkg/info/telnet.md5sums
/var/lib/dpkg/alternatives/telnet
colinux:~#


As far as " /etc/init.d " on my target board(cobra5329) there is not any folder of "init.d" is present here is the result of /etc directory

# ls
var tmp usr sys proc opt mnt lib home etc dev bin
# cd etc/
# ls
version rc inittab support config
services motd inetd.conf default
#


on my colinux console this is the directories in my /etc folder

at.deny gateways modprobe.d rc4.d
bash.bashrc groff modules rc5.d
bash_completion group modules.conf rc6.d
bash_completion.d group- modules.conf.old rcS.d
bind group.org modutils reportbug.conf
calendar host.conf motd resolv.conf
checksecurity.conf hostname motd.old rmt
complete.tcsh hosts.allow mtab rpc
console hosts.deny mtools.conf securetty
console-tools identd.conf nanorc securetty.dpkg-old
cron.d identd.key network security
cron.daily inetd.conf nsswitch.conf services
cron.hourly init.d openoffice shells
cron.monthly inittab opt skel
cron.weekly inputrc pam.conf ssh
crontab issue pam.d sysctl.conf
csh.cshrc issue.net passwd syslog.conf
csh.login ld.so.cache passwd- terminfo
csh.logout ld.so.conf passwd.org updatedb.conf
debconf.conf ldap perl version
debfoster.conf locale.alias ppp wgetrc
debian_version locale.gen printcap
default localtime profile
deluser.conf login.defs protocols
colinux:/etc#


Also

colinux:/etc# uname -a
Linux colinux 2.6.11-co-0.6.3 #1 Tue Apr 4 15:30:02 CEST 2006 i686 GNU/Linux


As far as ssh is concerned I am not avoiding it and I can use ssh instead of telnet there is no problem in this case too and yes you are right in the case of communicating with the embedded host but in this colinux installation process I have both option I can Install it on the host os as Linux too, but right now I am using it with the host os as windows XP.

theNbomr 08-04-2011 11:32 AM

Quote:

Originally Posted by zawii87 (Post 4433348)
I don't understand in which envioremmenr I need to check these test on my target board or on my colinux enviorement.

And on my previous post, I said: "On the embedded host, at a shell commandline:"

Quote:

on the terget board console via hyper terminal it didn't work at all and it says

# find / -name "telnet*"
find: not found


# help

Built-in commands:
-------------------
. : break cd continue eval exec exit export help login newgrp
read readonly set shift times trap umask wait

Okay, we really have some work to do. The target embedded host has almost no user support. It seems to be running a busybox or similar shell, with only the barest amount of built-ins.
Quote:

on the Colinux window it gives me this output :

colinux:~# find / -name "telnet*"
/etc/alternatives/telnet
The Colinux on on Windows is of little importance to us, except that it seems to have an ssh client.

Quote:

As far as " /etc/init.d " on my target board(cobra5329) there is not any folder of "init.d" is present here is the result of /etc directory

# ls
var tmp usr sys proc opt mnt lib home etc dev bin
# cd etc/
# ls
version rc inittab support config
services motd inetd.conf default
#
So this embedded Linux seems to have very little in terms of daemon services. Even worse, very little in the way of how to find anything. Out of curiosity, what is the intended end use of the target system?
Quote:

Also

colinux:/etc# uname -a
Linux colinux 2.6.11-co-0.6.3 #1 Tue Apr 4 15:30:02 CEST 2006 i686 GNU/Linux
This looks like it comes from the Windows package. Again, we don't care about this part. I assume results are similar or identical on the target host.
Quote:

As far as ssh is concerned I am not avoiding it and I can use ssh instead of telnet there is no problem
Okay, so then try ssh. Your Windows-based Colinux seems to have an ssh client. Try using that to log into your embedded host:
Code:

ssh root@192.168.4.33
If this works, is your problem solved?
If not, then we have a tremendous amount of work to do. I will probably be able to guide you through it, but there will be a huge amount of learning for you to do. Unless there is a repository somewhere that has a ready-made telnet server, you will have to do the following:
  1. Identify the target host CPU details
  2. Create a software development cross-toolchain for the target architecture on either Windows or your Windows-hosted Colinux
  3. Locate and download a telnet daemon source code package
  4. Use the cross-toolchain to build the telnet server daemon on the Windows host
  5. Copy/move the telnet server binaries to the target host
  6. Configure the startup scripting that launches the telnet server
Each one of these is a substantial project in its own right. For someone completely un-acquainted with Linux, I would have to question whether you really want to try it. If you do, expect it to take a month of full-time effort; maybe more. There will be some challenges.

--- rod.

zawii87 08-05-2011 04:10 AM

this

"ssh root@192.168.4.33" does not work too

My target board contains the following items in its binary folder, may be this would be a little help

# ls
var tmp usr sys proc opt mnt lib home etc dev bin
# cd bin/
# ls
slideshow sh ntetris more head df
paintraw route nterm mkdir halt dd
demo-select rmdir npanel ls grep date
adcread rm netflash ln gdbserver ctest
adcdemo pwd nanowm launcher fbset cp
oszi ps nano-X landmine false chmod
vi portmap mv kill expand cat
umount ping muserfd init eraseall can_send
true nxview mtest2 inetd erase boa
top nxterm mtest ifconfig env [
tftp nxlsclients mterm hwclock echo busybox
test nxkbd msh hostname dmesg
telnet nxev move horch discard
slider nxclock mount hexdump dhcpcd
#



yes you are right my target host is running BusyBox and when I type msh which may be the command for buil in shell then it shows me this message.


# msh


BusyBox v1.00 (2006.11.14-12:36+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
#


and also by typing msh root@192.168.4.33 its gives me this message

# msh root@192.168.4.33
root@192.168.4.33: cannot open
#

You are right about that Complexity of work I have to do to keep this thing running. Actually this Embedded system based BSP is the evaluation edition of cobra5329 and they have also mentioned that this evaluation edition comes with no additional configuration support and if you want to have complete support then you have to buy the professional edition , and when I contacted with the company of this product to have the professional edition they said that we don't sell the professional edition any more because this is a very ancient one and we provide no further support on this product. Also they said if you want to have some further support on this product then we can specifically provide help to you according to your requirements which clearly means that they want more money in this case .

Also I contacted the hardware vendor of this board support package and they replied me after much discussion that

"
In principle, there already exists a telnet server in the µCLinux distribution, but it is not integrated in the precompiled BSP. It would make some effort to reconfigure and create a new image.
You would have to reconfigure µCLinux with kconfig and recompile it with the included toolchain in the BSP. A documentation how to create a new
image to flash on the board is included in the BSP. But the fundamental TCP/IP communication should work with the precompiled BSP image.
"

And I didn't understand much from this, I will try to do this thing if it would happen correctly with me

theNbomr 08-05-2011 08:44 AM

Okay, I did some research of my own, and it seems that your Windows CoLinux package includes all of the cross-development toolchain required to build software for the target. I suggest you start by acquainting yourself with it, and building some simple packages. It also appears that busybox is capable of providing telnetd support, so adding it that way seems like the easiest route. Locate the busybox sources (might be part of the development environment, otherwise download it from the Busybox web site.

If you use a source package included with the development packages, it may have an existing .config file that matches the configuration of busybox that you are using now. You would then have to run make menuconfig to start up the configuration tool, and select the new telnetd component.

With luck, your development system should be set up to correctly build code to run on the target host. If so, building packages may be as simple as the use three-step process: configure; make; make install. If not, you will have to do some reading a figure out what to do to accommodate the toolchain.

Your development system should have some documentation that describes how to move the new object code to the target board. If you get that wrong, it is possible that you will end up with an un-bootable and un-fixable target; i.e. a 'bricked' board. The methods used for getting code onto single board computers that boot from flash memory are not generic. Every system requires its own specific methods, and may require additional hardware such as a JTAG dongle. It is best if you do some heavy research on this subject before attempting to move new software to the target. I cannot emphasize the importance of this too much. Don't wade in just experimenting and trying things without knowing the exact procedure.

--- rod.

zawii87 08-08-2011 03:35 AM

I think we should wait until Wednesday, because on Wednesday I will have discussion with the technical team with the manufacture company of the target board.

I hope I will have some more focused and precised help from them about my target host "cobra5329"

Can you suggest me some important and helpful questions that I should ask from technical team after judging from all my above discussion that what I need to perform with my target host

theNbomr 08-08-2011 09:49 AM

Yes, ask them how to move application binaries to the target filesystem. Ask them if it is possible to brick the board by doing it incorrectly. Hopefully it is not; better to know beforehand.

--- rod.

zawii87 08-10-2011 09:48 AM

Telnet sever is not pre compiled in this board support package and we have to reconfigure it with the new image file and that is itself a lengthy and time consuming procedure.

I want to do TCP/IP Communication with the host-PC and I have checked it by pinging that the Ethernet connection is working fine between the PC and my target host. So for this just skipping the creation of new telnet server I am going towards TCP/IP communication over Ethernet.

Now I need to write TCP application on both side means on my Host PC and also on my target host Cobra5329 so that It can send and Receive TCP packets from both sided

First I am starting from the target board side I need to write TCP-Read and TCP-write for bidirectional Communication.

Can you suggest me any helping guide for TCP application developing that from where I need to start because I really don't have any idea about coding related to this and that's my first experience in writing this kind of application specifically for the taget host ( Cobra5329 )


All times are GMT -5. The time now is 02:52 AM.