How to program UDOO ???

Discussion in 'Application & Utilities' started by xwalter, Sep 25, 2014.

  1. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    The udooubuntu Os installed on the board is Ubuntu 12.04 LTS m with limits respect ubuntu 12.04
    I would like to installa Netbeans IDE to start a simple program under java as I'm doing in my desktop pc .
    But difficult to find the JDK 7 for that ....
    I had tried to open Codeblokcs but after to select any types of project only a console project was running in a console project where I print "Hello " ....other kind of project to manage the UDOO hardware or powerfull are for me impossible to do because not any project runs .
    I had tried to write some code in Geany but there are not button to lanch a project , diffucult to understand
    I had tried to launch python but I dont' know how to import and to find the modules ...ò
    Pratically my UDOO is only connected over internet but I cannot not to program nothing
    How to use serial or ethernet , how to use UDOO ???????????????????????????????????????????????????????
    I want to create an application with some windows with 2- or three buttons but it's impossible , under java doesn't works , under codeblocks doesn't work , under python doesn' work
    What can I do with a mini computer without promming it ???
    If I use my desktop pc under win7 in a few minuts I can connect my serial port with ARduino uno , mega and Due
    Here I have Arduino Due and a mini pc but nothing works
    Why don't the support team make a serious tutorial where to explain how to use and where to find the library o drivers to use in a final user application ?
    We have a Ferrari stopped in a garage without use it
    Please tell me some infromations , make something ....
    Team has installed different programming environment but without examples , which kind of project I have to create for an apllication in Codeblocks for examples , what I have to # Include for that ?
    It's uncredible after two weeks without program nothing , daiiiiiii
    regards
    Walter
     
  2. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    how it is possible to sell a mini computer without any examples of code and tutorial on programming , this is the most important motive that people buy this board
    If I want to play with terminal I have also Ubuntu 14 64 bit in my desktop , I had bought UDOO to program it in according with ARduino due , but how to do that ?
    Nobody knows what to do , how other people program to udoo ?
     
  3. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    I have installed Netbeans 7.4.1 from Lubuntu Software Center , and download all off the package .
    I launch a desktop application but doesn't work
    I had create a new java application with just a import of java.awt.Panel ;
    After the compilation when I press the start button they come out a list of errors .
    Just a simple console application is runnig
    Pratically also with java is not possible to program this board.
    This is a big delusion , more than 145 euro lost into the w.c.
    What can i do with udoo , open the terminal or open notepad or scrath or GImP ?
    :lol: :lol: :lol:
    What is the use of it , open terminal and send some text to arduino maybe , if I want to switch on my light I have to bring with me always the keyboard and the mouse and then I can switch a light in my office by using the XTerminal :lol:
    Gentleman of the team , but are you sure this project will fly high ?
    Could you please tell me what can I do with this card because I have Two processors , ARM + ARM but nobody know how to program them (ok arduino I know because there are books and tutorials)
    I'm just thinking to learn Raspberry , because you say that Udoo=4 Raspberry but raspberry doesn't use your official OS
    Why dont' you list a web site where to learn your card or write a good manual , serious and full of ideas ?
    Tomorrow I will try to use Bluefish :lol:
     
  4. indianerjones

    indianerjones New Member

    Joined:
    Mar 10, 2014
    Messages:
    18
    Likes Received:
    1
    This is a very good example of what not to do in case you experience problems with coding^^.

    For someone claiming to be programming for 15 years you don't show a lot of experience with getting support. Looks more like you've been breathing for only 15 years.

    All of the problems you describe are not even really Udoo-specific. You clearly don't have a clue what you are doing, do not post any error messages that might help people help you and just rant, senselessly alienating anyone able to support you. Udoo isn't a super-special platform, it's a Linux computer with an Arduino attached to one serial port, there is so much documentation on this setup.

    So, if anyone reads this thread and is scared that Udoo might be a broken platform: It isn't. There are a few badly documented problems, but most tasks you want to do on a normal Linux PC can be done without any adjustment whatsoever, using all the tutorials freely available, which the OP here demands be supplied to him by Udoo's developers. Hardware I/O doesn't work out of the box, but I've seen some impressive projects here at my company.

    There should really be a more active community here, but this is not the way to get there, xwalter.
     
  5. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    Indiana ....
    looking at the web , everywhere , the UDOO classic words are :
    "UDOO : a new platform to easy learn to program , young and old people can learn to program with this board , UDOO=4 Raspberry + Arduino Due "
    Isn't right ?
    When I bought Arduino Uno , Mega and Due , after 5 minutes I was able to program any platform , after I saw documentation , examples and tutorial I was eble to program all arduino platforms using Atmel Studio + Visual Micro or Visual Studio + Visual Micro and I had developed also some interestig library you can see in the future as WHome, WTimer , WArdumation ect ...because now I0m testing them .
    After 5 minuted you are also able to program Raspberry , or Beaglebone or NetDuino (in C# over .NET framework)
    With Microchip microcontroller DsPic30Fxxxx after one day you are able to make something and to communicate with a pc by using a uart or usb or else
    But with UDOO this not happen....
    The problem is not I'm learning linux/ubuntu because into my desktop I have ubuntu and I use eclipse and netbeans without any problem , I also use txrx library to use the serial ports or usb under ubuntu
    The UDOO board is manipulated by the team , if I want to use some pins or communicate with arduino due what can I do ?
    Where is the documetnation to inform me which system library to use or how to improve system calling to do this job with a programming language
    I saw the documetation , serial port or ehternet or usb are into a file , dev/xxx/xxx and you can set up the direction pin an/or read or write them values , but how to use this script in codeblocks for examples ? or netbeans or bluefish , which object to use to send to the OS these commands ?
    I'm following again the meteo station to understand better how they program UDOO side but most of the time is to how connect the sensors o what to do with the arduino due side , the web is full of arduino connections or programming but yet of udoo programming .
    If I program my ubuntu desktop I don't have pins or arduino side because if I had them I didn't buy udoo, it's clear to understand ?
    If you know what to do when programming udoo side why don't you post some procedures o little code , you will be happy a lot of people .
    Tell me , to program udoo board what I have to use ...Codeblocks ? Which kind of project type I should to select whe I create the project ? Which library or header files I have to include into the project to produce an application wich send commands to arduino due or receive or what can I do if I want to use the pins directly in UDOObuntu OS ? ....the terminal I know that's make this job but I to use into the C/C++ code for example
    If you wrote to other people do not read my post and not to believe me , well you or other people why do't you tell me what to do ?
    Why dont' you tell me how do you produce your projects , which language and how do you use it .....? tell me !!!
     
  6. delba

    delba Administrator Staff Member

    Joined:
    May 8, 2013
    Messages:
    1,064
    Likes Received:
    9
    xwalter,

    as indiana already said, the problems you describe are not really UDOO-specific.
    We're aware that our documentation is not 100% perfect, there are some problems that we're trying to solve, starting from basic tutorials that will help newbies to program with UDOO. We didn't create tutorials about Netbeans, bluefish and the other editors 'cause they're very popular and you can find guides everywhere. But we understand it could be a little difficult for the beginners. We're working everyday to improve the UDOO experience.

    That said, a couple of suggestions for the future in order to better ask support in any kind forum (not only UDOO Forum):

    - When you have a problem, be specific and clear. Other users don't waste their time replying to some confused sentences. I also suggest you to read our forum rules expecially the "be clear" part: forum-rules-t3.html
    - Describe the issue and paste your code between
    Code:
    
    
    explaining what does or does not work. Users need a context to better understand you. e.g.: ubuntu-lts-t1316-10.html#p10240
    - You can also use images or videos to explaining your issues better. e.g.: install-google-apps-t327-30.html#p8922
    - It's ok to criticize but only when your criticisms are constructive. Otherwise nothing good came out from there.
    - [This is about the following thread possibile-che-nesusno-del-team-sappia-dare-informazioni-t1859.html]: Never use Caps Lock in titles and texts, not a good behavior in forums where people search and give informations for free!
    - This is an English speaking forum, so i'm politely asking you to speak english so the other users can understand and help you (again, for free)! If you're having any problem about the language you can PM me in italian and i'll reply with info and help.

    Remember: Just be specific about your problem and we (or the community) will be more than happy to help you in any possible way.

    Take care
     
  7. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    Dear Sir ....
    Normally , each electronic/IT system has a very easy job to do ...to communicate with the rest of the world
    In UDOO I have had already installed some applications as Minicom , python , vnc server ect .
    I Had also read the udoo Beta Manual and I understood where to find I/O or serial device .
    In ubuntu desktop I have installed java with netbeans and rxtx comm java library but the problem is that UDOO has an ARM processor , not x86 or i86_64
    This means that the rxtx comm library doesn't works , I have a list of problem when I try to start an application in udoo , but of course the compiling job is done , this is because udoo supports netbeans and java but the hardware , the ARM, doesn't support the library .
    In the forums many people say that ubuntu is ubuntu and my problems are linked to that ...you are right ubuntu i ubuntu but udoo has a different processor than a desktop pc ...I hope to be clean now .
    Application as Arduino IDe or Serial Terminal or others , are GUI applications running on udoo and they use the serial com.Why I can't to use a serial for a GUI application on udoo
    Other thing ....you sell this board as 4 Raspberry + Arduino Due , the two processors are connected to communicate each other , how ? Why don't you supply for a develop environment or some libraries to make this job .
    For Raspberry there are a lots of discussions , many books and more ...for udoo nothing .
    You sell a hardware board without to give the way to use it , you cannot say it's my problem beacause onto udoo there is not a normal OS and the processor is an ARM ,it's an embedded system created by your company .
    I'm not here to ask about ubuntu because for my ubuntu desktop pc I'm able to find informations everywhere but not for a special mini pc with ARM .
    UDOO has GPIO and more devices , drivers ...the only information how to use them is to find Raspberry informations and do some changes to apply at udoo .Only python is able to do some works
    How the other people program udoo ? The use only terminal to send serial data and to set e pin direction or value?
    I have understood that GPIO are handled in files , in java o other language I can manage them using classes to work with file , but not serial .
    I have a mini pc , but what I have to do if I want to create a simple GUI application which uses the serial comm?
    Give an answer , maybe python , I have installed python-serial by terminal , but to have a GUI application what I need more ....maybe vxWidget for Python ? .....Why nobody respond to me .....
    ciao
     
  8. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    My question is easy to respond ....
    Can I uso UDOO to communicate with Arduino Due by serial port ( /dev/ttymxc3) and Can I create a GUI application to send data over the serial from UDOO to Arduino ?
    For example , I want to create a GUI application which read some analog values from Arduino and/or send some command to Arduino , switch on the relays ,leds ?
    My scope was to buy UDOO instead to do this job using a normal desktop pc or notebook .
    Your answer is YES or NOT ?
    Can I use ubuntu in udoo to have a simple GUI application to exchange data to and from Arduino Due or not?
    This job is possible to do in Android using Google ADK for Arduino , I know , I already use Android Studio to create apps and use them on the mobile .But I don't want to work in Android , I want to use udoo board in ubuntu if it is possible .
    So , in C/C++ nobodyknow what to do , in java nobody what to do , now I'm trying to understand by using python
    In python I can use the serial port of udoo , but I'm not sure if the GUI library will work with it .
    You just tell me that udoo is not able to run a simple application using the seiral port and for me is finish , amen , it means that I bought a mini pc for nothing , I return to windows 8 or Mobile o else
    I think now my request to understand is clear .
    Don't play with words with me everytime, just respond to me , I'm loosing too much time .
    I bought this mini pc because I thank that was possible to run some GUI application to communicate with ARduino or external boards to drive motors , lights, domotika , automation , not for play at MAME , for that I use my desktop
    Could you please respond to me ?
     
  9. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    now I use
    1 - Arduino Uno , ,Mega , Due
    2 - desktop -windows7
    3 - visual studio or java + serial com library
    I create some windows to insert data from arduino , I show some data in the window , I save data in postGreSQL , I use a client -server application to exchange data with Plc or else
    *********************************************************************
    Should I do the same job using UDOO ?
    UDOO is a mini pc which support ubuntu OS , it's possible to run some GUI application directly in udoo without use an other pc ?
    This is what I want , because this is what a simple pc or mini pc must give me .
    You show some 3D apllication to run in udoo for games , for me it's enaugh 2D simple GUI application ....with buttons, texbox and serial communication
    Do you think this is possible to realize with udoo , yes or not ?
    Thank you ;)
     
  10. delba

    delba Administrator Staff Member

    Joined:
    May 8, 2013
    Messages:
    1,064
    Likes Received:
    9
    Hi Walter,

    i’m replying you about all the ways to create a GUI to control the serial port on UDOO.

    Java and Python are not the only way to use the serial port, all the programming languages have libraries to control the serial port /dev/ttymxc3. We know that the library part on UDOO needs to be improved, we didn’t have much time to create our own libraries but, as i said before, all the languages have their own libraries (and ways) to control the /dev/ttymxc3.

    For example: in one of our demos called Carmadillo (a RC car) https://github.com/UDOOProjects/CarmadilloMk1 we use Java with the rxtx library to communicate with Arduino (through the serial port):

    Code:
    void connect ( String portName ) throws Exception
    
        {
    
            CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);
    
            if ( portIdentifier.isCurrentlyOwned() )
    
            {
    
                System.out.println("Error: Port is currently in use");
    
            }
    
            else
    
            {
    
                CommPort commPort = portIdentifier.open(this.getClass().getName(),2000);
    
                
    
                if ( commPort instanceof SerialPort )
    
                {
    
                    SerialPort serialPort = (SerialPort) commPort;
    
                    serialPort.setSerialPortParams(230400,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,
    
                    		SerialPort.PARITY_NONE);
    
                    
    
                    out = serialPort.getOutputStream();                
    
    
    
    
                }
    
                else
    
                {
    
                    System.out.println("Error: Only serial ports are handled by this example.");
    
                }
    
            }     
    
        }
    
    	
    
        static public void serialWrite ( byte[] joystickIn )
    
        {
    
        	/*	
    
        	 * 	joystickIn[0] -> direction
    
        	 * 	joystickIn[1] -> speed
    
        	 *  joystickIn[2] -> pan
    
        	 *  joystickIn[3] -> tilt
    
        	 *  joystickIn[4] -> command
    
        	 */
    
        		
    
    		if(joystickIn[0] < 0) joystickIn[0]     =  (byte)0;
    
    		if(joystickIn[0] > 180) joystickIn[0]   =  (byte)180;
    
    		if(joystickIn[1] < 0) joystickIn[1]  	=  (byte)0;
    
    		if(joystickIn[1] > 180) joystickIn[1] 	=  (byte)180;
    
    		if(joystickIn[2] < 5) joystickIn[2]     =  (byte)5;
    
    		if(joystickIn[2] > 180) joystickIn[2]   =  (byte)180;
    
    		if(joystickIn[3] < 10) joystickIn[3] 	=  (byte)10;
    
    		if(joystickIn[3] > 125) joystickIn[3] 	=  (byte)125;
    
            	
    
    		System.out.println("dir: " + joystickIn[0] 
    
    				+ " - speed: " + joystickIn[1] 
    
    				+ " - pan: " + joystickIn[2] 
    
    				+ " - tilt: " + joystickIn[3]
    
    				+ " - command: " + joystickIn[4]);
    
    		
    
    		try
    
            {        
    
    			out.write(joystickIn);               
    
            }
    
            catch ( IOException e )
    
            {
    
                e.printStackTrace();
    
            }            
    
        }
    
    here you can find all the main.java file: https://github.com/UDOOProjects/Carmadi ... oMain.java


    An example in C:

    The following code has 2 methods (set_interface_attribs e set_blocking) to configure the serial. At the end of the code you’ll see the Main with examples of how to open and use the serial port. In C you can create GUI using, among other things, QT http://www.udoo.org/qt-3d-with-opengl-es-2-0/ or gtk: http://www.gtk.org/.

    Code:
    #include <errno.h>
    #include <termios.h>
    #include <unistd.h>
    #include <fcntl.h>
    
    int
    set_interface_attribs (int fd, int speed, int parity)
    {
           struct termios tty;
           memset (&tty, 0, sizeof tty);
           if (tcgetattr (fd, &tty) != 0)
           {
                   error_message ("error %d from tcgetattr", errno);
                   return -1;
           }
    
           cfsetospeed (&tty, speed);
           cfsetispeed (&tty, speed);
    
           tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8;     // 8-bit chars
           // disable IGNBRK for mismatched speed tests; otherwise receive break
           // as \000 chars
           tty.c_iflag &= ~IGNBRK;         // ignore break signal
           tty.c_lflag = 0;                // no signaling chars, no echo,
                                           // no canonical processing
           tty.c_oflag = 0;                // no remapping, no delays
           tty.c_cc[VMIN]  = 0;            // read doesn't block
           tty.c_cc[VTIME] = 5;            // 0.5 seconds read timeout
    
           tty.c_iflag &= ~(IXON | IXOFF | IXANY); // shut off xon/xoff ctrl
    
           tty.c_cflag |= (CLOCAL | CREAD);// ignore modem controls,
                                           // enable reading
           tty.c_cflag &= ~(PARENB | PARODD);      // shut off parity
           tty.c_cflag |= parity;
           tty.c_cflag &= ~CSTOPB;
           tty.c_cflag &= ~CRTSCTS;
    
           if (tcsetattr (fd, TCSANOW, &tty) != 0)
           {
                   error_message ("error %d from tcsetattr", errno);
                   return -1;
           }
           return 0;
    }
    
    void
    set_blocking (int fd, int should_block)
    {
           struct termios tty;
           memset (&tty, 0, sizeof tty);
           if (tcgetattr (fd, &tty) != 0)
           {
                   error_message ("error %d from tggetattr", errno);
                   return;
           }
    
           tty.c_cc[VMIN]  = should_block ? 1 : 0;
           tty.c_cc[VTIME] = 5;            // 0.5 seconds read timeout
    
           if (tcsetattr (fd, TCSANOW, &tty) != 0)
                   error_message ("error %d setting term attributes", errno);
    }
    
    
    === inside main() ===
    ...
    char *portname = "/dev/ttyUSB1"
    ...
    int fd = open (portname, O_RDWR | O_NOCTTY | O_SYNC);
    if (fd < 0)
    {
           error_message ("error %d opening %s: %s", errno, portname, strerror (errno));
           return;
    }
    
    set_interface_attribs (fd, B115200, 0);  // set speed to 115,200 bps, 8n1 (no parity)
    set_blocking (fd, 0);                // set no blocking
    
    write (fd, "hello!\n", 7);           // send 7 character greeting
    char buf [100];
    
    An example in Bash with the Zenity library (we used it to create our UDOO Configuration Tool): https://github.com/ektor5/udooconfig

    Be aware though, creating GUI in Linux is not the easiest thing in the world, but for whom that works in the programming field should be doable.

    I’ll give you an example of GUI in Android we created for the UDOO Mario project (Mouse and Keyboard works pretty well in Android):
    This project has a GUI controlled using a Touch screen 7” with some buttons that activate specific functions (e.g. servo motors, speech recognition etc…). We use Google ADK to send and receive informations through the Native USB of UDOO: http://www.udoo.org/ProjectsAndTutorial ... lioID=1394
    Here you can find the github: https://github.com/UDOOProjects/UDOOMario
    Here you can find the Library created by palazzem that allows to easily control the ADK protocol: https://github.com/palazzem/adk-toolkit
     
  11. mikelangeloz

    mikelangeloz Member

    Joined:
    Jul 9, 2013
    Messages:
    129
    Likes Received:
    1
  12. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    thanks a lot delba ....and thanks to michelangeloz
    Now it's better .
    I will look and study your links
    ;)
     

Share This Page