New IT forum Follow us on Twitter
22 May 2012, 10:18:53 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: TonidoPlug2 - Now in stock!
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Newbie question on the Dreamplug environment  (Read 704 times)
Grinch
Newbie
*
Posts: 38


« on: 31 January 2012, 01:34:07 pm »

Dear all, this is my first post.
I'm a designer of custom board with microcontroller and this is my first approach to a SBC as Dreamplug, I'm also new to Linux environment.
Actually I've get working the UART-JTAG interface by using VirtualBOX on a WinXP machine, inside the VirtualBOX I'm running a Fedora 16 virtual machine.
From the Fedora shell (I'm logged as root) I've set the minicom terminal program as suggested into the DreamPlug user guide and now I'm able to see the booting process.
After I've logged in into the dreamplug (after some time of Google search and more...) I can see:

dreamplug-debian:~#

I type the command:

uname -r

and I can see as reply 2.6.33.6.

After that I've did:

uname -a

and the reply was

Linux dreamplug-debian 2.6.33.6 #1 PREEMPT Tue Feb 8 03:18:41 EST 2011 armv5tel GNU/Linux

From my very little knowledge of Linux this is form me a big success, I can understand that trough the JTAG/UART port I can connect the Dreamplug and see the shell command.
Now as my purpose I've to setup a application coded in c language able to make some data exchange trough a external hardware, this can be did over the Dreamplug USB port or over the Ethernet port. This is my goal.
As Ive wrote I'm a newbie into this system then I like to ask you if someone can give me some hint how to start in coding and debugging with DreamPlug, in fact this environment is quite different from a desktop PC (we have a GUI) and I think this is more similar to program a microcontroller (e.g. using MPLAB and a C complier to show a practical example with PIC microcontroller) then I've to use a C compiler environment, then I think to gcc and then develop my application.
At now I'm stop in front of the Dreamplug terminal because I've to learn how I can start in coding, there is some API manual or some similar that is able to show how setup a USB or Ethernet communication trough the Dreamplug and the outside world? From the coding point of view, I don't have a GUI interface then I think that I have to work only trough the line command then using text editor I'm right?

I'm sorry if this question may appear stupid but just think to a newbie which like to learn more and enter in a really new world which is very different from the desktop Windows and the microcontroller classical workflow, this is really difficult start in a right way, could you help me to start into the right direction? I'm a fan of knowledge sharing then will be a pleasure put all my experience in a single document may be useful also for other people that like me just starting now from scratch into this new world.

Hope you can help a electronic/software lover.

Best regards
Grinch



* Logged-in-Dreamplug-VirtualBOX-WinXP-Fedora16.jpg (170.07 KB, 1680x1020 - viewed 24 times.)
« Last Edit: 31 January 2012, 01:54:46 pm by Grinch » Logged
Confusticated
New IT customer
Hero Member
*
Posts: 511


« Reply #1 on: 31 January 2012, 07:42:31 pm »

You can develop in your Fedora 16 Virtual Machine with Editor\IDE of your choice (using a cross compiler) and transfer the binary to the Dreamplug via your network (over SSH).

Here is a pointer in the right direction for Fedora 16:-
http://fedoraproject.org/wiki/Architectures/ARM/CrossToolchain

Have a play, if you get stuck, post here again.
Logged

Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!
Grinch
Newbie
*
Posts: 38


« Reply #2 on: 31 January 2012, 09:05:01 pm »

Dear Confusticated,
first thank you for the link.

http://fedoraproject.org/wiki/Architectures/ARM/CrossToolchain

Well at this time I've read a little bit over the net, crosscompiling means a way to compile a program for some target platform but this task can be did by working on another one that can be the same type of different. From what I've read I need a toolchain then the gcc, and a linker able to work in Fedora and able also to generate a binary executable file that is able to run into the Dreamplug environment. I'm right?
Using the crosscompiling strategy I can run the toolchain from a GUI like eclipse or from command line inside Fedora.
If all I've written above is right then the cross toolchain linked is the best choice because by using it I can compile to a target ARM processor by working to the source directly inside the Fedora x86 environment (the use a tect editor like gedit), now I've a doubt, from the link I can read:

"This will install everything necessary to run the C compiler and cross-build ARM libraries and binaries that are entirely binary compatible with the native Fedora/ARM libraries and binaries"

now I've some (may be) stupid question but just be patient I'm really starting from scratch.

I've see that the cross compiler environment at the proposed link work from the command line.
The first question is about the library that I can use, I'm try now to better explain this concept. Suppose that I've to send some data trough the USB or the Ethernet port then I think that I need to use some dedicated API's call which is supported from the installed Dreamplug kernel, where I can found some documentation? To make a Windows example where I can found the Dreamplug kernel equivalent library collection like the MSDN for the Visual Studio environment?

The second question is in what way I can upload and then execute my binary into the Dreamplug? I'm thinking to create a folder into the home directory which is into the Dreamplug root and then put inside this folder my binary executable files, if my approach is right then I've to first make the cross compiling stage and the after this upload the binary file(s) to the Dreamplug. I've read about SSH I've to start a SSH session to update files to the Dreamplug or I can did it trough the shell in some way? Be patient but I've to clear my head from the classical micrcontroller approach trough Windows in order to step right into the Linux world.

Thanks again and my

best regards
Logged
Grinch
Newbie
*
Posts: 38


« Reply #3 on: 01 February 2012, 06:49:07 pm »

Dear Confusticated,
I've also another question for you.
When you write:

"You can develop in your Fedora 16 Virtual Machine with Editor\IDE of your choice (using a cross compiler) and transfer the binary to the Dreamplug via your network (over SSH)."

you means login to the Dreamplug over a wired ethernet or wireless one? I've some confusion on this point. From the manual I can see that the Dreamplug came configured as Access Point as default mode and I've to switch to client mode wlan.sh in order to use the client mode. Well at the Dreamplug starting I can see the SSID of the Dreamplug over the available wireless network list but when I switch to the client mode by typing the command wlan.sh this disappear. Now is the question, in order to make a SSH connection in what way I can did it? Over wireless the module is reachable trough the default IP 192.168.1.1 or I can try also trough the Ethernet (then wired) port with same address?
I can't set up a real test now because I've already into my network a wireless device with same IP then the next question is is possible to change the default IP address from 192.168.1.1 to another one?

Sorry for this question but I'm try to learn from zero  Huh

Thanks in advance

Regards
The Grinch

« Last Edit: 05 February 2012, 11:00:12 am by Grinch » Logged
Confusticated
New IT customer
Hero Member
*
Posts: 511


« Reply #4 on: 01 February 2012, 07:33:53 pm »

Quote
supported from the installed Dreamplug kernel, where I can found some documentation?
In the kernel documentation that comes with the kernel source.

Quote
I've to start a SSH session to update files to the Dreamplug or I can did it trough the shell in some way?
Enter
Code:
man scp
at a console prompt within your virtual machine for guidance.

Quote
login to the Dreamplug over a wired ethernet or wireless one?
Your choice, I personally prefer wired ethernet.

Quote
is is possible to change the default IP address
Connect the ethernet port nearest the middle of the dreamplug (eth0) to your broadband router with a cat5e cable, it should pick up an IP address automatically from your router.
To learn how to set a specific IP, google something like 'static ip debian'
Logged

Advocatus Diaboli - My agenda is not to give you the answer, but to guide your thoughts so you derive it for yourself!
Grinch
Newbie
*
Posts: 38


« Reply #5 on: 02 February 2012, 10:09:22 am »

Dear Confusticated,
about the first point regarding the kernel documentation I take the download page at this URL:

http://code.google.com/p/dreamplug/downloads/list

now there is several files, to be more precise I can see:

- linux-2.6.33.6.tar.bz2 (linux-2.6.33.6)
- dreamplug_debian_v0.2.zip.001 and dreamplug_debian_v0.2.zip.002 (dreamplug_debian_v0.2.tar.gz (1/2) and (2/2))
- uImage (kernel of Dreamplug)

now I've some question concerning this first issue (kernel documentation).

1. the first one namely linux-2.6.33.6 should be the original Linux kernel (then this is not a particolar distribution, just the original kernel), right?

2. the dreamplug_debian_v0.2 file should be the debian distribution builed with the Linux 2.6.33.6 kernel then means the kernel with some other application in order to form a Linux distribution. Right?

3. The uImage is the compressed form of the Linux kernel then I think is again the previous linux-2.6.33.6 kernel, just build as image. Right?

From the above consideration I think that file of my interesting should be the "dreamplug_debian_v0.2.zip", now I've just finish to downloading it but I've a trouble in open the archivie this is the error reported when I try to unzip the file:

Archive:  /home/ste/Documenti/dreamplug_debian_v0.2.zip.001
[/home/ste/Documenti/dreamplug_debian_v0.2.zip.001]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
zipinfo:  cannot find zipfile directory in one of /home/ste/Documenti/dreamplug_debian_v0.2.zip.001 or
          /home/ste/Documenti/dreamplug_debian_v0.2.zip.001.zip, and cannot find /home/ste/Documenti/dreamplug_debian_v0.2.zip.001.ZIP, period.

I've just download these file from the Dreamplug repository with Firefox from Fedora but I'm unable to open it, could you please help me? From some point of view Linux seems give more pain than Win system...

Best regards
The Grinch


* Image1.jpg (43.39 KB, 911x354 - viewed 10 times.)

* image2.jpg (51.73 KB, 603x516 - viewed 10 times.)
« Last Edit: 02 February 2012, 11:20:03 am by Grinch » Logged
Grinch
Newbie
*
Posts: 38


« Reply #6 on: 02 February 2012, 11:44:45 am »

Hi,
I've tried the SSH connection and seems ok, could you simply confirm?

Starting from zero I've did these step.

1. Open a Terminal (root) in Fedora 16
2. Launch minicom with the right setup (ttyUSB0, 115200 8N1 No Hw ans Sw Flow control)
3. Connect the eth0 to my wired network
4. Power up the Dreamplug
5. After booting I've set up the Dreamplug login
6. now I've switched from AP to client mode by issuing this command

dreamplug-debian:~# /usr/bin/wlan.sh

By using the ifconfig command I've read the IP address assigned to the Dreamplug into the my network, this was equal to 192.168.2.101

dreamplug-debian:~# ifconfig                                                    
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx                        
          inet addr:192.168.2.101  Bcast:192.168.2.255  Mask:255.255.255.0      
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/xx Scope:Link                  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                    
          RX packets:376 errors:0 dropped:0 overruns:0 frame:0                  
          TX packets:80 errors:0 dropped:0 overruns:0 carrier:0                
          collisions:0 txqueuelen:1000                                          
          RX bytes:44400 (43.3 KiB)  TX bytes:9742 (9.5 KiB)                    
          Interrupt:11

7. Now I've set the SSH connection by using this command:

dreamplug-debian:~# ssh root@192.168.2.101

the Dreamplug reply was:
The authenticity of host '192.168.2.101 (192.168.2.101)' can't be established.  
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.        
Are you sure you want to continue connecting (yes/no)? yes                      
Warning: Permanently added '192.168.2.101' (RSA) to the list of known hosts.
root@192.168.2.101's password:

Then I've write the password (nosoup4u) and finally I got:

Linux dreamplug-debian 2.6.33.6 #1 PREEMPT Tue Feb 8 03:18:41 EST 2011 armv5tel
                                                                                
The programs included with the Debian GNU/Linux system are free software;      
the exact distribution terms for each program are described in the              
individual files in /usr/share/doc/*/copyright.                                
                                                                                
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent              
permitted by applicable law.                                                    
Last login: Fri Aug 26 11:23:35 2011                                            
dreamplug-debian:~#

At this time I can suppose that my connection from Fedora 16 to the Dreamplug will be over the SSH connection and was established over the wired ethernet network on the Dreamplug port eth0 I'm right or I've did some mistake or I've not understanding some concept?

I've did a mistake or I've to setup another shell into the Fedora 16 and then inside this shell make the ssh command above mentioned? I've also did this last things and I'm able to login from the shell to the Dreamplug then I think that either is a valid way.

Could someone simply gimme a confirm that all above is right?

Thanks in advance
The Grinch
« Last Edit: 02 February 2012, 12:19:16 pm by Grinch » Logged
Grinch
Newbie
*
Posts: 38


« Reply #7 on: 02 February 2012, 03:38:52 pm »

Dear Confusticated,
I'm proudly to let you know my first success.

- I've installed the cross toolchain (downloaded and installed without error from your URL, thank!)
- I've write the usual Hello World with gedit in Fedora 16
- I've compiled the hello.c source with the toolchain:

[root@localhost ProgC]# armv5tel-redhat-linux-gnueabi-gcc -Wall -o hello hello.c

no warning arise

- I've uploaded the compiled hello file to the DreamPlug by using the scp command (again thank for the hint):

[root@localhost ProgC]# scp hello root@192.168.2.101:/home/myprog
root@192.168.2.101's password:
hello                                                        100% 5415     5.3KB/s   00:00  

- Now I've to switch to the DreamPlug shell in order to sure about the file and it was into the right place (yup!!)

dreamplug-debian:/home/myprog# ls
hello

- Now from the DreamPlug shell I'm try to run the hello executable file:

dreamplug-debian:/home/myprog# ./hello                            
Hello, World

YEAHHH it's work!!!!

Thank you Confusticated, with your hint I was able to write and execute my first C program on the DreamPlug!!!

Thanks in advance and my
best regards

The Grinch

* hello-arch.zip (2.37 KB - downloaded 5 times.)
« Last Edit: 05 February 2012, 11:01:34 am by Grinch » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!