Recent Updates Page 2 RSS Hide threads | Keyboard Shortcuts

  • Heavy duty pull sensors

    Ellen 18:21 on June 25, 2012 | 0 Permalink | Reply
    Tags: , , ,

    Interacting with installations with a long life time we turn to heavy duty sensors that can handle a lot of cycles. The string and pull sensors below can handle more than a million cycles and are built for industrial use. They can also be connected to circuit board like Arduino.

    Check out all the pull sensors and string pots from Celesco. Novotechnik also offers a wide range of pull sensors.

    Check out this Processing and Arduino project by nhw3030 with Celesco string sensors.

  • Unity + Processing + Arduino

    Ellen 10:32 on May 31, 2012 | 18 Permalink | Reply
    Tags: , , , ,

    I did a test connecting Arduino and Unity with the help of Processing and a Open Sound Control library. When I am pushing the Flexi Force sensor the values affect a cube within Unity. To get this setup do the following:

    Arduino
    Load the Standard Firmdata on to your Arduino. Check out a full Arduino + Processing tutorial to get the setup.

    Processing
    Download the oscP5 processing library and put it in your Processing sketch folder in the folder libraries.

    Initialize oscP5 library and broadcast data to port 12000. The port Unity will listen to.
    Add the remote location to listen to on port 3200. If Unity would broadcast event in this example, the broadcast port would be set to 3200. Initialise Arduino to be used later on.

    oscP5 = new OscP5(this,12000);
      myRemoteLocation = new NetAddress("127.0.0.1",3200);
      arduino = new Arduino(this, Arduino.list()[0], 57600);

    In the draw function we read the analoge pin 0 to get sensor values from the Flexi Force sensor. Set the OSC message to flexiforce. Unity will listen to this label. Add the message of the sensor value into the osc message with add method. This method can take numbers, strings and byte data.

    float flexiforceSensor = arduino.analogRead(0);
    OscMessage oscMess = new OscMessage("/flexiforce");
    oscMess.add(flexiforceSensor);

    oscP5.send(oscMess, myRemoteLocation);

    The entire Processing sketch can be seen here.

    Unity
    In Unity you can import the Osc.cs and UDPPacketIO.cs to broadcast and listen to UDP data.

    Set up the corresponding host and ports in your Unity script.

    public var OSCHost : String = "127.0.0.1";
    public var SendToPort : int = 3200;
    public var ListenerPort : int = 12000;

    Import the UDPPacketIO and Osc components and feed in the host and ports. Add your specific label of your osc message and what method to call when receiving this event from Processing.

    var udp : UDPPacketIO = GetComponent("UDPPacketIO");
    udp.init(OSCHost, SendToPort, ListenerPort);
           
    handler = GetComponent("Osc");
    handler.init(udp);
    handler.SetAddressHandler("/flexiforce", AffectObject);

    In the receiving method you can print out the label and message values. In this case the sensor value from the Flexi Force. The cube will change width when getting a new value from Processing.

    public function AffectObject(oscMessage : OscMessage) : void
    {      
            Debug.Log("Event name: " + Osc.OscMessageToString(oscMessage));
            Debug.Log("Event data: " + oscMessage.Values[0]);
           
            var myCube = GameObject.Find("Cube");
            var boxWidth:int = 8 - ( oscMessage.Values[0]);
            myCube.transform.localScale = Vector3(boxWidth,5,5);
    }

    • Pablo 10:46 on June 5, 2012 Permalink

      great tutorial! do you have the entire source code available??

    • Juan 13:27 on June 16, 2012 Permalink

      Hi Ellen,
      As Pablo said: GREAT JOB!
      I’m trying to do the same, can you email me the sorce code?

      Thanks a lot

      Juan

    • Mikael 02:22 on June 22, 2012 Permalink

      How can I find the Osc.cs and UDPPacketIO.cs for the Unity?

      And yes I expect to have the source code also.

      Thank you,

      Mikael

    • Ellen 16:46 on June 25, 2012 Permalink

      The Osc.cs and UDPPacketIO.cs files are now available for download within the post. I will post the source code to the project shortly!

    • Ellen 18:00 on June 26, 2012 Permalink

      Source code and Processing example can be downloaded from here: https://github.com/ellensundh/Bocki_unity_processing/zipball/master

    • Ellen 10:13 on July 2, 2012 Permalink

      Test out the demo of Unity and Processing here: http://www.sundh.com/blog/2012/07/unity-processing-demo/

    • between0and1 19:58 on August 6, 2012 Permalink

      HI, I really like the tutorial and am excited to make it work full through. I’ve got all the processing / arduino bits working, but on moving into Unity I get a null reference exception on the line
      udp.init(-args-)

      I’m assuming it has to do with the way it is trying to access UDPPacketIO script, but I don’t yet have enough experience to know how to modify this to work properly.
      I’ve downloaded your processing demo and worked on it from there, but still can’t quite get it.

      Thanks for the demo! I’m excited to move forward wit this

    • Ellen 07:42 on September 6, 2012 Permalink

      @between0and1 Which platform are you on? If you run WIndows you need to change a line UDPPacketIO.cs. On Mac you import IO like this: “using System.IO;”. On Windows you need to add .Ports so you import ” System.IO.Ports;”

    • shanshan 23:01 on October 6, 2012 Permalink

      Hi Ellen
      Thank you so much for sharing resources and knowledge! this is amazing!

    • Matthias 10:46 on October 24, 2012 Permalink

      What is this error?

      Exception in thread “Animation Thread” java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy

    • Oliver Jones 00:19 on January 27, 2013 Permalink

      Nice work Ellen! Is it possible to reverse this? So I can send variables from Unity, into Processing?

    • jim 20:52 on August 3, 2013 Permalink

      thanks for the tutorial! I run the processing and it works fine, it is printing the correct “flexiforceSensor” value . but when running Unity3D, the eventName and eventData are empty…..any idea what went wrong?

    • Ellen 02:11 on November 14, 2013 Permalink

      @Jim Please double check the ports you are listening in to. There are helpful applications for that to see what you input and output. When I find the link the the aswome app I used I will post it here!

    • Michael 04:29 on April 16, 2014 Permalink

      Ellen this is great but I’m stumped on the UDPPacketIO.cs issue. I’m on Windows, so
      even after changing adding .Ports to get ” System.IO.Ports;” I still get a NullReference error in Unity. I must have retried this and scoured the code for any issues for an hour. Everything looks fine but I can’t find a solution. I’ve checked all over the net and no answers. Any help is greatly appreciated.

  • Add app to Facebook page

    Ellen 16:46 on May 30, 2012 | 0 Permalink | Reply
    Tags: , Facebook app,

    If you want to add your app to a Facebook page, you will have to do the following.

    1. Prepare your app

    Make sure your have has valid URLs to point to from the little thumbnail in the Facebook page. Add an image that will be displayed. To fit the image into the area on the Facebook page it needs to be 111 x 74 px.

    add_app_facebook_page

    2. Add the app
    To add the app to the page you need to run the following link:

    https://www.facebook.com/dialog/pagetab?app_id=[APP_ID]&next=[PAGE_TAB_URL]

    The app id can be found https://developers.facebook.com/apps/
    facebook_app_your_app
    3. Add page tab dialog
    The page tab dialog will show all the pages you have admin permissions to.
    add_page_tab_facebook

  • Notes from Facebook Garage in Stockholm

    Ellen 13:40 on May 26, 2012 | 0 Permalink | Reply
    Tags: ,

    facebook_garage_stockholm

    Tagging users
    Application can tag people in updates. Permissions needed.
    The application can add a personal message to the update and also add it after the action was published.

    User generated photos
    It is now possible to post large photos in the news feed even without uploading it to a Facebook album.
    The difference is that the image is uploaded to your own server. The image URL is then passed to the Open Graph together with other optional values like:
    sources – Image URL
    large – If the image should be big (boolean)
    expires_in – How long the post should exist (seconds)
    tags – User ids in array to pass tagged users
    message – Your personal message
    place – Id of Facebook place
    your own actions – Verbs

    Post it to the graph with /me/[namespace_of_app]:your_action

    Download the example application here: https://bitbucket.org/brucehazan/ios-sample-og
    Example includes single sign in with Facebook iOS SDK.

    Add app from Timeline
    If friends are using a Facebook app and a post appears in your news feed and you don’t have the app, you can install the app in a click of a button. The button on the post says “Add app”.
    To enable it put a URL in Profile URL in application settings.

    Publish past on user timeline
    Post past things on the users timeline
    Button to fill out past timeline

    Map Stories
    Specify long and lat on a page can be added in meta tags. Your post can be associated with a location.

    New Feed Aggregations
    The more traffic a post gets it gets highlighted in the news feed.

    Action links on OG Stories
    Accept Diff – Authenticate the application to display application-functionality in the post:
    https://developers.facebook.com/docs/opengraph/actionlinks/

    Permissions
    offline_access – Depreciated
    Valid for 60 days is the only thing that can be used. As long as the user used your app you have 60 days to access the user.

    publish_stream includes publish_actions by default now.

    iOS Deep Linking
    It is possible to deep link into an iOS app from posts of the mobile Facebook app. If the user doesn’t have the app, the user will be directed to the App Store. After installing it the deep link is active.
    This is not new but it just launched for Android.
    To enabled it just check the box of iOS Native Deeplinking in your Application settings.

    Facebook requests
    Facebook requests from Facebook applications can be sent directly to the iOS device linking the user directly to your native iOS app with Facebook integration.

    App Center
    Facebook launched the App Center where all Facebook apps are shown in an App Store-like matter. The apps will show screenshots and rating from users.

  • Geek Girl Meetup in London

    Ellen 15:33 on April 29, 2012 | 0 Permalink | Reply
    Tags: , Geek Girl Meetup 2012, geekgirl,

    Spending the day at Geek Girl Meetup in London. Talked about The Sound of Football and my Arduino projects.

    In the Arduino session I presented my Depressed Shoe Shelf, the bend sensing belt Bad Posture, how to control electronics from the internet using Processing.

    google_campus_society46_680

  • Arduino library for LED Message Display

    Ellen 18:53 on April 15, 2012 | 13 Permalink | Reply
    Tags: , Arduino library, , LED

    Making life a lot easier I wrote an Arduino library that takes care of converting strings and calculating the checksum of all commands sent to the LED Message Display. Compared to the first example of sending text to the display the library can send commands of how long the text should display, how to be animated in and out and display European characters. All included in the BockiMessageBoard library on Github.

    amplus_led_message_display_sundh

    The code below shows how to initiate and send messages:

    #include <BockiMessageBoard.h>

    BockiMessageBoard messageBoard = BockiMessageBoard(0); // 0 is the Id of your message board

    void setup {
          // Configure the display before sending the text.
          int displayTime = 0.5; // Input 0.5 sec or 1 to 25 seconds
          messageBoard.configure(displayTime,SCROLLLEFT,VERTICALCLOSE);
    }

    void loop {
          String euroChars = "Testing with European characters <U45><U44><U76><U65><U64><U61>";
          messageBoard.displayMessage(PAGE_A,euroChars);
    }

    The library generate serial data to the LED Message Display with this setup:

    <ID00><L1><PA><FE><MA><WC><FD>MESSAGE CHECKSUM<E>

    <ID00> - The id of the message board.
    <L1> - Line number
    <PA> - Page id
    <FE> - How the text will appear. Scrolling, twinkeling, snowing…
    <MA> -
    <WC> - Waiting time. How long to display text.
    <FD> - How the text will disappear. Scrolling, twinkeling, snowing…
    MESSAGE - The message text to be displayed
    CHECKSUM - Hex value calculated on all tag sabove.
    <E> - End of data.

    The circuit uses a RJ14 cable to transfer the serial data to the display board:
    ethernet_led_bb

    • Nelson 01:41 on June 25, 2012 Permalink

      Dear Ellen:
      Loved this project ! CONGRATULATIONS.
      I wonder how did you get the communication protocol?
      It happened to me having a couple of identical Displays with different protocols, all of the from China same format and features.
      Can you share with me the protocol of this particular Display?
      Thank you so much.
      Cheers.
      Nelson

    • Led Writing Board 08:21 on August 13, 2012 Permalink

      This is the nice blog . There are many information of led writing board if you want get more information and uses of led boards then visit Led writing Board

    • Mostafa Hamdy 04:44 on January 22, 2013 Permalink

      i like this project very much & please i have some questions :

      1- can i define where the message i sent it will appear in the led display ?
      2- can i show two different message in the same time ?
      3- can i use it like LCD arduino libirary ( first set cursor then print message and clear it when i need )
      4- if you have video for this project after implementation can you send to me
      Thanks :)

    • Mostafa Hamdy 05:33 on January 22, 2013 Permalink

      5- can i print or show variable value in this libirary
      messageBoard.displayMessage(PAGE_A,”My message!”);
      i need to print variable x can i do this
      messageBoard.displayMessage(PAGE_A, x);

    • Davy 10:16 on June 3, 2013 Permalink

      I used one these and this library. The one I purchased in the UK from Maplin had an RS232 interface – so I had to use a mini TTL to RS232 converter. I added colour as well which is just an additional . This is particularity good. Thanks for the lib – works well and to that Erasmus lad who figured out the checksum…

    • antonis 09:22 on July 11, 2013 Permalink

      i wanted to know how you connect TTL to arduino?
      Which pins on arduino you used?

    • mike 21:17 on September 29, 2013 Permalink

      Anyone know of the Maplin code of the LED display used by Davy?

    • Antonio 17:49 on October 21, 2013 Permalink

      Hi Ellen, can activated message with and external switch, I need to have around six different messages activated independently by a six switches.

      Regard
      Antonio

    • John 16:50 on December 26, 2013 Permalink

      hello,

      i have an arduino and the same led display, but i can’t get the code working, i dont now of i am missing some files or something.
      can you help me?

    • Morris 11:51 on March 3, 2014 Permalink

      Hi Ellen,
      Is the AM07231H11 (red character only display fromAmplus) supported by your library ?
      Regard,
      Morris

    • Ellen 22:27 on April 1, 2014 Permalink

      @Morris Yes, the display and code only supports red characters. Depeding on what type of display board you have, you might find the answer in this guide: http://www.electronicdisplays.com/database/files/Communication%20EDV111-780-MC%20Protocol%20LED%20Display%20Board%20V240232485.pdf

      Looks like CX is the color code.

    • Ellen 22:29 on April 1, 2014 Permalink

      @Mostafa Hamdy Yes you can, but it’s a limit of characters supported, only English characters with the code supplied.

  • Make WiShield work in latest Arduino IDE

    Ellen 17:22 on February 17, 2012 | 28 Permalink | Reply
    Tags: , , wishield

    1. Download the WiShield library that has been optimized and fixed by users:

    2. Rename the folder to WiShield and put it into Arduino_sketch_folder/libraries
    You might notice that just running a sketch with the WiShield library will generate errors like:

    return type specified for ‘virtual void Server::write(uint8_t)’
    clock-arch.c:44:20: error: wiring.h: No such file or directory

    3. In order to get rid of these error you need to change the corresponding names in the following files:

    clock-arch.c
    Replace #include “wiring.h” with #include “Arduino.h”

    WiShield.cpp
    Replace #include “WProgram.h” to #include “Arduino.h”

    WiServer.cpp
    Replace #include “WProgram.h” to #include “Arduino.h”
    Replace void Server::write(uint8_t.. to be size_t Server::write(uint8_t..

    WiServer.h
    Replace virtual void write(uint8_t); to virtual size_t write(uint8_t);

    • David 18:21 on February 24, 2012 Permalink

      Great tip!

      However, to make it work with my yellowjacket board, I had to take the regular WiShield github branch. The Wishield_user_contrib branch may have been forked before something was fixed. But I took the newest files from the user_contrib (WiServer.cpp, apps-conf.h, g2100.c and uip.c) to get advantage of their fixes too, and then made your modifications, and it is working fine now!

      Thanks!

    • Tommy Thorn 02:09 on March 12, 2012 Permalink

      I wonder why we get a different result. The latest Arduino IDE I see is 1.0. When I installed on my mac and I apply the changes you suggest I get
      In file included from webserver.c:38:
      /Volumes/tommy/Documents/Arduino/libraries/WiShield/webserver.h:43: error: conflicting types for ‘uip_tcp_appstate_t’
      /Volumes/tommy/Documents/Arduino/libraries/WiShield/server.h:65: error: previous declaration of ‘uip_tcp_appstate_t’ was here

      I notice that the Rugged Circuits Version 1.3.1 gives me the same result, so
      what am I missing? Thanks.

    • Tom Ashe 19:40 on March 19, 2012 Permalink

      Tommy… This is what you are missing, if you have not found it already. The errors you are getting are caused by the apps-config.h file. It has a series of #defines that are supposed to be commented out and uncommented for the sketch you want to run.
      The file comes with the APP_WISERVER uncommented. This causes the errors you are getting.
      The fix: comment this out and uncomment APP_WEBSERVER and the errors will disappear. Nothing else is required, if you downloaded 1.3.1 from Rugged Circuits.

    • Pedro 22:13 on March 25, 2012 Permalink

      i have the same issu when i try to compile and example.
      Can anybody tell me what i am doing wrong plz.

    • orcuthe 15:42 on April 2, 2012 Permalink

      Worked fine with Wifi Bee.

      Thanks a lot.

    • Ron 18:33 on April 9, 2012 Permalink

      Same here? all the above changes where done…

      In file included from /Users/dvdrony/Documents/Arduino/libraries/WiShield/request.cpp:32:
      /Users/dvdrony/Documents/Arduino/libraries/WiShield/WiServer.h:198: error: conflicting return type specified for ‘virtual void Server::write(uint8_t)’
      /Users/dvdrony/Desktop/~Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error: overriding ‘virtual size_t Print::write(uint8_t)’

      Thanks!

    • Ellen 15:07 on April 13, 2012 Permalink

      @Ron You need to change the return type to size_t in WiServer.h in order for Print.h do follow the interface.

    • Todd 12:36 on May 6, 2012 Permalink

      Thank you, just what I was looking for.

    • Alexander 10:48 on May 10, 2012 Permalink

      Hi, i’m an Italian Student and i have some problem to compile my first wifi arduino application.

      The ide write this error:

      SimpleServer:15: error: conflicting declaration ‘const prog_char ssid []‘
      config.h:43: error: ’ssid’ has a previous declaration as ‘char ssid []‘

      how i can fix this?

      thanks to all…

    • NelsonConect 01:38 on May 13, 2012 Permalink

      Its work for me, but the wishield with flash dont work.

    • Ellen 08:45 on May 31, 2012 Permalink

      Hi Nelson!

      How is your setup with wishield with flash?

    • Pozza 23:23 on May 31, 2012 Permalink

      Alexander
      I had a similar problem with conflicting declarations. It was due to me having 2 versions of the same file, as the board I used, had it’s own version of the file.

      remove one, and that fixed it for me.

      Hope this helps.

    • Ady 22:31 on June 14, 2012 Permalink

      In file included from D:\download\arduino-0023\libraries\wifilib/apps-conf.h:46,
      from D:\download\arduino-0023\libraries\wifilib/uip-conf.h:141,
      from D:\download\arduino-0023\libraries\wifilib/uipopt.h:104,
      from D:\download\arduino-0023\libraries\wifilib/socketapp.h:41,
      from socketapp.c:46:
      D:\download\arduino-0023\libraries\wifilib/webserver.h:46: error: two or more data types in declaration specifiers

    • Ady 22:31 on June 14, 2012 Permalink

      pls help me!!!

    • matt 16:17 on June 20, 2012 Permalink

      Hi Ellen,

      following the posts on (Ellen 17:22 on February 17, 2012 | 14) and (Tom Ashe 19:40 on March 19, 2012 ), i got the WebServer example to upload and work, :-)

      then i tried to get the TinyREST server to work and started getting:
      TinyREST_mpb20120619b:17: error: conflicting declaration ‘const prog_char ssid []‘
      /Users/matt/Documents/Arduino/libraries/WiShield/config.h:44: error: ’ssid’ has a previous declaration as ‘char ssid []‘

      where are (Pozza 23:23 on May 31, 2012 ) multiple versions hiding?

      i have deleted Arduino 1.0.1 on my Mac and i still get the same errors.

      i went back to the WebServer and it also is giving me the same error now, even though it had uploaded and worked, :-(

      /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=101 -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Users/matt/Documents/Arduino/libraries/WiShield /tmp/build6266653682354258881.tmp/WebServer_mpb20120617.cpp -o /tmp/build6266653682354258881.tmp/WebServer_mpb20120617.cpp.o
      WebServer_mpb20120617.cpp:19: warning: only initialized variables can be placed into program memory area
      WebServer_mpb20120617:15: error: conflicting declaration ‘const prog_char ssid []‘
      /Users/matt/Documents/Arduino/libraries/WiShield/config.h:44: error: ’ssid’ has a previous declaration as ‘char ssid []‘
      WebServer_mpb20120617.cpp:24: warning: only initialized variables can be placed into program memory area
      WebServer_mpb20120617.cpp:28: warning: only initialized variables can be placed into program memory area
      WebServer_mpb20120617.cpp:49: warning: only initialized variables can be placed into program memory area

    • Youmna 03:21 on June 25, 2012 Permalink

      THANKS!!@

    • Brian Ballsun-Stanton 19:31 on July 11, 2012 Permalink

      Matt, I made, in config.h, char ssid to prog_char, and in the demo, removed the constant.

    • Chrigu 12:53 on October 27, 2012 Permalink

      God thank you soo much Ellen! I spent already hours trying to fix things!

    • Christian 23:00 on November 7, 2012 Permalink

      Hi Ellen, I just got one error now: /Applications/Arduino.app/Contents/Resources/Java/libraries/WiShield/clock-arch.c:44:10: error: #include expects “FILENAME” or This is pointing on: #include “Arduino.h” which seems strange? Can you pls help?

    • Poledust 20:33 on November 25, 2012 Permalink

      I have made the changes that you have suggested here and it did allow me to load to the mega 2560 but the Wishield 2.0 still will not light up and I cant see the Wishield over wifi. In case I am in the wrong place I am using a Arduino mega 2560 with a Wishield 2.0 I have found several blogs and or sites with so many different solutions to this problem and I have tried all of them and still it doesnt work I dont know much about this stuff to get to deep on my own. I would appriciate any help!

    • liuxy 05:52 on January 19, 2013 Permalink

      help me !!

      void udpapp_init(void)
      {
      uip_ipaddr_t addr;
      struct uip_udp_conn *c;

      uip_ipaddr(&addr, 192,168,1,100);
      c = uip_udp_new(&addr, HTONS(0));
      if(c != NULL) {
      uip_udp_bind(c, HTONS(12344));
      }

      s.state = STATE_INIT;

      PT_INIT(&s.pt);
      }

      udpapp.c: In function ‘udpapp_init’:
      udpapp.c:58: error: dereferencing pointer to incomplete type

    • Dave 06:43 on February 27, 2013 Permalink

      How do I go about opening and modifying these files on a PC (windows 7)?

    • ulka 10:35 on March 8, 2013 Permalink

      I hv made the changes but got following…

      In file included from webclient.c:37:
      C:\Program Files\arduino-1.0.3\libraries\WiShield/webclient.h:106: error: conflicting types for ‘uip_tcp_appstate_t’
      C:\Program Files\arduino-1.0.3\libraries\WiShield/server.h:65: error: previous declaration of ‘uip_tcp_appstate_t’ was here

      plz help..

      ulka

    • mrjeeves 10:13 on April 10, 2013 Permalink

      To solve the dereferenced pointer issue for the udpapp, in uip-conf.h, change the 0 to a 1:

      #define UIP_CONF_UDP 0

      to

      #define UIP_CONF_UDP 1

      (original thread) http://www.linksprite.com/forum/index.php?topic=190.0

    • GK22 03:57 on November 13, 2013 Permalink

      I am trying to use this with a Mega 2560. I have made all of the changes recommended above, but I still get the following errors. Any thoughts?

    • Walter 05:12 on February 10, 2014 Permalink

      hi there, strange thing, i can connect the wishield to my wireless network, and the SimpleServer sketch compiles (with your suggested changes) and it appears to connect to my wifi… however i cannot reach the ip address via any browser… I’m at a loss… here is the code:

      /*
      * A simple sketch that uses WiServer to serve a web page
      */

      #include

      // Wireless configuration parameters —————————————-
      unsigned char local_ip[] = {192,168,10,41}; // IP address of WiShield
      unsigned char gateway_ip[] = {192,168,10,1}; // router or gateway IP address
      unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
      char ssid[] = {”Sophie2″}; // max 32 bytes
      unsigned char security_type = 3; // 0 – open; 1 – WEP; 2 – WPA; 3 – WPA2

      // WPA/WPA2 passphrase
      const prog_char security_passphrase[] PROGMEM = {”4416651121″}; // max 64 characters

      // WEP 128-bit keys
      prog_uchar wep_keys[] PROGMEM = {
      0×01, 0×10, 0×65, 0×10, 0×20, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, // Key 0
      0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, // Key 1
      0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, // Key 2
      0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00, 0×00 // Key 3
      };

      // setup the wireless mode; infrastructure – connect to AP; adhoc – connect to another WiFi device
      #define WIRELESS_MODE_INFRA 1
      #define WIRELESS_MODE_ADHOC 2
      unsigned char wireless_mode = WIRELESS_MODE_INFRA;
      unsigned char ssid_len;
      unsigned char security_passphrase_len;
      // End of wireless configuration parameters —————————————-

      // This is our page serving function that generates web pages
      boolean sendMyPage(char* URL) {

      // Check if the requested URL matches “/”
      if (strcmp(URL, “/”) == 0) {
      // Use WiServer’s print and println functions to write out the page content
      WiServer.print(”");
      WiServer.print(”Hello World!”);
      WiServer.print(”");

      // URL was recognized
      return true;
      }
      // URL not found
      return false;
      }

      void setup() {
      // Initialize WiServer and have it use the sendMyPage function to serve pages
      WiServer.init(sendMyPage);

      // Enable Serial output and ask WiServer to generate log messages (optional)
      Serial.begin(57600);
      WiServer.enableVerboseMode(true);
      }

      void loop(){

      // Run WiServer
      WiServer.server_task();

      delay(10);
      }

  • Get analog value from Yellow Jacket

    Ellen 22:07 on February 14, 2012 | 1 Permalink | Reply
    Tags: Asynclabs, , Rugged Circuits,

    rugged_circuitThe Yellow Jacket wifi microcontroller originally from Asynclabs is being produced by The Rugged Circuits. I got one and here is a tutorial on how to read an analogue value from the board.

    The Yellow Jacket is using the library WiShield from Asynclabs. I have seen a lot of puzzled comments on how to get it working. Just running one of the WiShield examples in the latest Arduino IDE gave me a few errors:

    “error: conflicting return type specified for ‘virtual void Server::write(uint8_t)’”

    It seems like the WiShield library isn’t really up to sync with the latest Arduino IDE. So I used the older Arduino IDE and downloaded the WiShield 1.3.0 library which is made for the older Arduino 0022.

    Your network settings
    Next thing I modified the example SimpleClient with my personal network settings. The local ip is the address where I will be able to access the board from and with that the sensor value of the analog input. In your network settings you can see what type of security settings your network has. Change the digit in code to correspond to your network’s security type. In my case I have got a WPA2 password that I enter in the code.

    unsigned char local_ip[] = {192,168,2,240};     // I choose a free IP address in my network
    unsigned char gateway_ip[] = {192,168,2,1}; // Address of my router
    unsigned char subnet_mask[] = {255,255,255,0};
    const prog_char ssid[] PROGMEM = {"NAME_OF_MY_WIFI_NETWORK"};
    unsigned char security_type = 3;        // 0 – open; 1 – WEP; 2 – WPA; 3 – WPA2
    // WPA/WPA2 passphrase
    const prog_char security_passphrase[] PROGMEM = {"my_password"};

    Initializing WiServer
    In the setup method of the sketch the WiServer is initialized together with the name of a function defining what we will see when surfing into the board.

    void setup() {
    WiServer.init(sendMyPage);
    WiServer.enableVerboseMode(true);
    }

    Serving data to web page
    As in any Arduino sketch the analog value can be reached through analogRead. Within the method sendMyPage the content of the web page is printed together with the sensor value.

    With WiServer.print we serve the value to

    WiServer.print("");
    sensorValue = analogRead(sensorPin);
    WiServer.print("sensorValue :");
    WiServer.print(sensorValue);
    WiServer.print("");

    Good to know-list
    Good to know when uploading your code to the board:

    • You need to set your board type to Arduino Uno.
    • It will take about 30 seconds for the Yellow Jacket to start up after uploading the code or adding power to it.
    • You can source the Yellow Jacket with its own power by adding 7V-24VDC to pin raw.
    • Depending on which code library you want to use you need to activate it in apps-conf.h within the WiServer library code. In this example I have uncommented #define APP_WISERVER

    • Tom Ashe 17:35 on April 1, 2012 Permalink

      Having a time trying to get the YJ to connect to software on Mac or iPhone. I am using webserver sketch in adhoc mode. I have no router/gateway in my project. The YJ connects to the devices with no problem but the software cannot make a connect. I can find no examples where no gateway/router is being used. It requires a gateway ip address. What should be done in my case/
      Thanks,
      Tom

  • Develop for Android on your Mac

    Ellen 12:53 on January 19, 2012 | 0 Permalink | Reply
    Tags: ADT Plugin, android, Eclipse

    Here is a short tutorial on how to install all you need for Android development on a Mac.

    1. Download Eclipse 3.2, 3.3 (Europa) for your Mac on:
    http://www.eclipse.org/downloads/

    2. Download the Android SDK from here:
    http://developer.android.com/sdk/index.html

    2. Once you installed the SDK you can get the latest update from this command-line command by
    executing:

    tools/android update sdk

    3. Install the ADT plugin
    - Start Eclipse, then select Help ]]> Install New Software…
    - Click on add and the window below will appear. Input the URL https://dl-ssl.google.com/android/eclipse/. Use http if https does not work. Name it “ADT Plugin”.

    android_adt_plugin

    - Click on Next, and then Next agian and accept the license agreements. Click on Finish.
    - Restart Eclipse

    4. Create an AVD Manager
    - In order to run our Android app on the Mac we need to set up an Android Virtual Device in Eclipse.
    Window > AVD Manager
    - Create a new AVD by clicking on new
    - Type in the name of your avd, in my case my_avd
    - Choose a target.
    The target is the platform (that is, the version of the Android SDK, such as 2.3.3) you want to run on the emulator. I chose the latest one I got.
    - Click create!
    android_virtual_device_manager

    5. Now you are up and running!
    Why not start with a simple Hello World:
    http://developer.android.com/resources/tutorials/hello-world.html

  • Small Ehternet access just got smaller

    Ellen 22:08 on January 12, 2012 | 0 Permalink | Reply
    Tags: , arduino shield, , ethernet, freetronics

    ethernet

    The Arduino Ethernet shield has been around for some time now. It’s a great solution for cutting out the middle man of the computer when check things online from the Arduino. In order to build smaller cases I stumbled upon EtherTen from Freetronics. It’s a fully Arduino-compatible board that runs Arduino code AND connects to internet with Ethernet.

    Lets make a list of the pros:
    - Smaller than Arduino board with Ethernet shield on top
    - Runs Arduino Ethernet library
    - Power of Ethernet, no power supply needed (!!!!)
    - Micro SD card holder
    - And sexy round corners (rounder than the Ethernet Shield)
    - Neat mini USB socket

    When it arrived I simply ran the TwitterClient file by Tom Igoe in Ethernet examples of the Arduino IDE and it was up and running. To call my custom php file was a bit harder though. Example code to be posted on my Arduino Circuit Blog shortly.

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel