Opening Serial Port Is Failed Skybox Sports

The serial monitor in the Arduino IDE picks up the serial port from the setting in the menu Tools > Port (which is also used for your upload), but other programs will need it to be explicitly set. – dlu Nov 26 '15 at 20:09. Failed to open serial port COM3 to communicate with board Uno. Make sure there is no other MATLAB arduino object for this board. For troubleshooting, see Arduino Hardware Troubleshooting. Aug 27, 2014 when i use the upgrade tool recover skybox stuck on load it says synchronizing STBS please reset target but i get opening serial port failed how to i get my serial. 'opening serial port is failed'.

Created on: 2 June 2015

In this project, an Arduino and Ethernet shield are used to get live cricket scores from the Internet. The same technique could be used to get sport scores for other sports.

The Arduino sketch configures the Arduino as an Ethernet client that periodically requests the scores from the cricbuzz.com website. The scores are received as an XML file which the Arduino parses to extract the score information.

The extracted scores and game information are displayed in the Arduino IDE serial monitor window.

This project can be used as a basis for getting started with similar projects for other sports scores and results. The code can also be adapted to support other displays such as an LCD.

The video below shows the Arduino fetching the sports scores and displaying them in the Serial Monitor window:

Update

See the improved cricket score ticker that uses an SD card to first save the entire XML file before parsing it.

Cricket Score Arduino Sketch

The code below can be copied and pasted to the Arduino IDE and then loaded to the Arduino.

Arduino Hardware

An Arduino and Ethernet shield or Arduino with built-in Ethernet is needed. The SD card is not used.

Running the Sketch and Serial Port Settings

After loading the sketch to the Arduino, open the Arduino IDE Serial Monitor window to view the scores. Make sure that the baud rate is set to 115200 as shown in the video above.

Sketch Limitations and Explanation

Opening Serial Port Is Failed Skybox Sports Today

Be sure to read the text below the sketch to understand the limitations of the sketch and for an explanation on how the code works.

Generate the Code

Use the form below to configure the sketch to suit your network and desired settings.

Change these settings to suit your network and Arduino board. After making changes, click the Generate Code button to apply the changes to the Arduino sketch below. Click the Select Code button to select the code for copying.

Amazon.co.uk


Code Notes and Limitations

Firstly note that this is a first attempt at parsing the XML cricket score file and uses a weak method of parsing the file. This is partly due to the memory limitations of the smaller Arduinos.

The buffering and parsing methods in this code are not efficient and can be improved – hopefully in a future project that will improve on this current project.

Because of the weak parsing techniques used in the code, it is possible that the code will break if anything unexpected is encountered in the XML file. This includes changing the order in which name/value pairs appear in the XML.

This project is really a quick sketch to get the cricket score displayed and to serve as a starting point for future better projects.

How the Sketch Works

Getting the XML into a Buffer

After connecting to the XML feed, the Arduino puts bytes received from the feed into the array / buffer pars_buffer[] one byte at a time. When the buffer is full, the entire buffer is left-shifted and each new byte is added to the end of the buffer after shifting.

The buffer is a 'window' of the incoming data that contains a portion of the incoming data limited by the size of the buffer. This buffer is parsed 'on the fly' by the Arduino without saving the entire incoming XML file to memory.

Parsing the Buffer

After a new byte is placed in the buffer, the buffer is checked to see if it contains the desired XML tag or name of a name/value pair. This is done by the ParseXMLBuffer() function.

The ParseXMLBuffer() function looks for for various tags and names in sequence in a switch statement. For example, it first looks for the opening <match tag, ignoring all other text until this tag is found.

After finding the opening match tag, it will then look for the type name and get and print the value of the match type using the PrintXMLNameValue() function e.g. if the name value pair is type='TEST' then the value TEST (for test match) is extracted and displayed.

Here we can see one of the weaknesses of the code in that it reads name/value pairs in the expected order. If any name/value pair order is changed the code will break.

Conditional Parsing

Some matches will be finished and will have a result. If the match result is available, then the data for the match will not contain information such as the number of overs and the current run rate. The result variable in the ParseXMLBuffer() function is used to flag matches that have a result so that the code does not try to extract data that does not exist for a finished match.

Only if the match does not have a result, will the function GetInningsDetail() be called that gets further live information about the match that is currently being played.

References and Other Information

Thanks to John for asking a question on the Starting Electronics blog about how to display the live cricket score which got this project started.

The client connection and resource request part of this project is based on two examples from the Arduino IDE built-in examples. These are found in the IDE under:

Opening
  • File → Examples → Ethernet → WebClient
  • File → Examples → Ethernet → WebClientRepeating

The pages for these two examples can be found on the Arduino website at:

The live cricket XML feed is read from http://synd.cricbuzz.com/j2me/1.0/livematches.xml


Please enable JavaScript to view the comments powered by Disqus.

Serial Port Is For

Arduino Software