APDuinOS (Flashing) — arduino IoT (internet of things) — aquaponic application

details

This product is an example of IoT device.
Generally user can make IoT Device easily by using APDuino platform.
APDuino platform would be included in IoT category of WIZnet Museum.

APDuinOS (Flashing) — arduino IoT (internet of things) — aquaponic application
2015-08-05_APDuinOS

 

 

FIRST REASON:
Is because you know nothing about APDuinOS and interested in what it is and how it relates IoT (Internet of Things).  You can learn more about APDuino by going to http://www.apduino.org  or http://www.apduino.com for more detailed information regarding this product. In general it is a IoT developed application for aquaponics and hydroponics systems.  It has functionality as a environmental monitoring software as well.  It will also allow you to control and interact with your physical world using sensor inputs to trigger actions through an Arduino™ and/or Raspberry Pi®

SECOND REASON:
This reason is why I have written this Instructable.  It is because I am a non-technical person that wants to test and play with this concept of controlling my aquaponic units without having to be a software or firmware engineer to be effective in control of them.  This direction should allow for getting the systems I build on to the internet and control them with minimum effort, but have total control of any number of sensors and what they interact with and allow for data collection and display .

I still do not fully understand all that is going on with this application, but at least writing this instructable and being able to refer back to it as a guide will help me to duplicate this process as many times as I need to in the future.

What Is Needed —

Picture of What Is Needed --

COMPUTER:
You will need a computer of some type.  It is my understanding that APDuino can be used with Windows, Apple and Linux machines.  I only work with Windows machines and currently working with Windows 7 on a laptop.  I know nothing about Apple or Linux machines.  So this instructable might not be able to help everyone, but the concepts and steps should give you a good idea of what is needed for non-Windows machines.  How you do it, I have no idea.

SOFTWARE:
Arduino IDE 1.X
Windows Command Prompt

HARDWARE:
Arduino Mega2560
Arduino Ethernet shield with data logging function
SD card

FILES:
avrdude
avrdude.conf
apduinos-headless.hex  –  downloaded from APDuino.org

OTHER:
Ethernet connection
USB cable

 

Which Option?

Picture of Which Option?

The APDuino user guild list 3 options to accomplish getting the APDuinOS on to your arduino.

You can find the reference here:
http://apduino.org/projects/apduinos/wiki/Flashing_APDuinOS

Flashing APDuinOS
you can get a flashable APDuinOS binary in various means:

1.  get a pre-built version of APDuinOS (headless only, currently)
2.  get the library and build the demo app
3.  get the library and develop your own APDuinOS-based app

OPTION 1:
This is the option that this Inscrutable is developed for.

OPTION 2:
you would need to be an arduino expert or software engineer to pursue this option.

OPTION 3:
you would need to be an arduino expert or software engineer to pursue this option.

 

SOFTWARE — That You Will Need to Use

Picture of SOFTWARE -- That You Will Need to Use
Picture of SOFTWARE -- That You Will Need to Use
Arduino 1.x software:
You will need to have version 1.x Arduino IDE installed and running on you computer.

Arduino 1.x relates to the version of the IDE you are running on your computer.  In this Instructable I will be using arduino-1.0.3 version.  There are later versions that are downloadable and used by a larger number of people.  You should know which version you are running by looking at the directory it is installed in.

If you need help to download and install version 1 Arduino IDE here is a reference that can help you:
http://arduino.cc/en/Guide/HomePage

WINDOWS COMMAND PROMPT:  (see picture 2 as to what this looks like)
In order to “FLASH” your arduino board you will need to use this software to make the loading of the binary hex file possible.

There is one of two ways to find “Windows Command Prompt” software on your computer.

FIRST WAY:
Use Windows “RUN” function window.  To get there you will need to click on windows ICON in the start area, then select  “ALL PROGRAMS”, then select  “ACCESSORIES” menu option.  Next select the “RUN” option.  A “RUN” window will open — Type “cmd”
in the “OPEN” box  and click “OK” and the command prompt window will open.

HERE IS A VISUAL OF THE ACTIONS:

SECOND WAY:
Use  “COMMAND PROMPT ICON” selection option.  To use it you will need to click on windows ICON in the start area, then select  “ALL PROGRAMS”, then select  “ACCESSORIES” menu option.  Next select the “COMMAND PROMPT” option.  The Command Prompt window will open and you are all set.

HERE IS A VISUAL OF THE ACTIONS:

 

 

Hardware — That Will Be Needed to Use APDuinoOS

Picture of Hardware --  That Will Be Needed to Use APDuinoOS
Picture of Hardware --  That Will Be Needed to Use APDuinoOS
Picture of Hardware --  That Will Be Needed to Use APDuinoOS
Picture of Hardware --  That Will Be Needed to Use APDuinoOS

Arduino Mega2560:
This is one of the core components for setting up your APDuino API.

I have gone with an official Arduino Board to insure a successful outcome for this learning experience.  I have found I need to minimize as many variables as possible when working with new technology.  It makes it a lot easier to trouble shoot problems when I know I am working with standard components.

Here is the arduino board being used in this instructable:  (as viewed in picture 2 of this set)
http://www.amazon.com/Arduino-MEGA-2560-R3/dp/B006H0DWZW

Arduino Ethernet shield with data logging function:
This is one of the other core component for setting up your APDuino API.

I again have gone with an official Arduino Board to insure a successful outcome for this learning experience for the same reasons as above.

Here is the arduino board being used in this instructable:  (as viewed in picture 4 of this set)
http://www.amazon.com/Arduino-Ethernet-Shield-R3/dp/B006UT97FE

SD card:
I decided to go with 16GB micro SD card as it was a good value with should be enough space until I figure out how much storage will really be needed once I go fully operational with a larger scale system.  It can be viewed in picture 3 of the picture set.

http://www.amazon.com/Sandisk-16GB-MicroSDHC-Memory-Class/dp/B001F7AJKI

 

Files Needed —

Picture of Files  Needed  --
Picture of Files  Needed  --
Picture of Files  Needed  --
Picture of Files  Needed  --

In order  to accomplish the task of flashing your arduino with the APDuinOS 3 files are required and used.

Here is a discussion of them and what there function is in this process.

avrdude:
This is the file that is responsible for uploading of APDuinOS to your arduino mega2560.

This file is installed when Arduino IDE is installed.  You need to verify that the file is in fact installed (see picture 2 in the picture set).  If not, you will get an error message when you attempt to upload the APDuinOS file .  Should “avrdude” not be found uninstall Arduino IDE and reinstall until “avrdude” can be verified in the correct sub-directory.

If you want to learn more about “avr” in general here is a link with more technical details and a tutorial about this type file.
http://www.ladyada.net/learn/avr/

avrdude.conf:
This file contains configuration data used by AVRDUDE which describes the (chip) programming hardware pinouts and also provides part definitions.

AVRDUDE’s “-C” command line option specifies the location of the configuration file.

The “-c” option names the programmer  configuration which must match one of the entry’s “id” parameter.

The “-p” option identifies which part AVRDUDE is going to be programming and must match one of the parts’ “id” parameter.
(source: avrdude.conf)

This file is also installed when Arduino IDE is installed, but in a different sub-directory than “avrdude”.  You need to verify that the file is in fact installed (see picture 3 in the picture set).  If not, you will get an error message when you attempt to upload the APDuinOS.   Should “avrdude.conf” not be found uninstall Arduino IDE and reinstall until “avrdudeconf” can be verified in the correct sub-directory.

apduinos-headless.hex  –  downloaded from APDuino.org 
The most current apduinos hex file needs to be downloaded to your computer.

This file once downloaded is the file that contains the hex code that will be uploaded to the Arduino Mega2560 and allows the arduino to interact with the APDuino API.

It can be downloaded here:
http://apduino.com/firmwares?search[platform_like]=Arduino

Once downloaded “apduinos-headless.hex” needs to be located in the same sub-directory as “avrdude” 
(see picture 4 in the picture set).

 

OTHER ITEMS REQURIED

Picture of OTHER ITEMS REQURIED

Ethernet Cable or Wireless connection:
In order to download “apduino-headless.hex”  you will need a internet connection.  But everyone knows this, but just had to cover it in case there are people that are very new to all this.

USB Cable:
Will need a A type to B type to connect computer to the arduino.

 

Working With “COMMAND PROMPT” — If You Need Help

Picture of Working With

For me this has been the hardest part of the whole project.  I have worked with command prompt way back in the past and was able to get around just OK.  There is no way around flashing the arduino mega2560 without using command prompt.  So if you know how to get around with a C:> you can skip this section of the instructable.

Here is a resource for learning or refreshing your command prompt skills:
http://www.youtube.com/watch?v=7Mu9ZxUHa-w

Here are some additional resources for helping with “Command Prompt”
http://www.guidingtech.com/12909/brilliant-command-prompt-cmd-tricks/

http://www.howtogeek.com/howto/25590/how-to-enable-ctrlv-for-pasting-in-the-windows-command-prompt/

I have found the biggest help in using command prompt is knowing what it is you want to do and where you want to be on your computer.  Just take your time and concentrate on where the files you need are located and work to get there.  Once there you can accomplish your task.

In my case I need to get to where I have my “avrdude” file to start.

Here is the path command I will have to use to get to the correct directory holding the“avrdude” file.  Again my directory could be installed differently than where yours is, so make sure you know how you installed your  Arduino IDE application.

Here is the path I need to use:
C:>Program Files\arduino-1.0.3\hardware\tools\avr\bin:>

“-cwiring” VS “-cstk500v2”

Picture of
Picture of
Picture of
Picture of

Things change almost daily in the technical world.  What worked one day might not work the next time you start it up.  Versions change, systems requirement change, hardware upgrades.  Almost anything at anytime.  So as things change so do the commands we use to get things to load-up.

It is important to read the on-line documentation in the user guide for all the latest updates and follow the instructions and keep trying until you get it right.  Make sure you contact tech support at APDuino should anything not work the way the documentation talks about.  APDuino’s founder is very interested in knowing how to improve and make things better.  So let them know issues you encounter.  They will work to resolve any and all issues for you.

Here are the current notes as of this writing about differences in versions of Arduino IDE and changes needed to be tried if things don’t work at first for your version of Windows or Arduino IDE.

UPDATE: recent feedback is that using Arduino IDE 1.0.2 on Windows 7, the “-cwiring” instead of “-cstk500v2” was leading to successful upload…

Link to apduinos flashing documentation:
http://apduino.org/projects/apduinos/wiki/Flashing_APDuinOS

Going forward with Windows 8 and new Arduino IDE releases things will require new an different solutions.

SCENARIOS – to use
These scenarios will be dependent on the version of Arduino IDE that is being used and what Directory  you installed the program files in.

SCENARIO ONE:
Using “-cstk500v2”
Work with this one first then move to next one if not successful. Mine looks like this, but your PATH could be different.

It is important that all spaces, quotes and special characters are all correct in the string.  The string has been cut due to  formatting issues with this instructable, but it should be one continuous input string when done in “Command Prompt” window :

SHOULD LOOK LIKE THIS:
C:\Program Files\arduino-1.0.3\hardware\tools\avr\bin\avrdude -patmega2560 -cstk500v2 “-P\\.\COM3” -b115200 -Uflash:w:apduinos-headless.hex:a “-CC:\Program Files\arduino-1.0.3\hardware\tools\avr\etc\avrdude.conf”

SCENARIO TWO:
Using  “–cwiring”
feedback has been to use “-cwiring” with Arduino IDE 1.0.2  and higher on Windows 7.

Move to this scenario if using “-cstk500v2” was not successful for you. Mine looks like this, but your PATH could be different.

It is important that all spaces, quotes and special characters are all correct in the string.  The string has been cut due to  formatting issues with this instructable, but it should be one continuous input string when done in “Command Prompt” window :

SHOULD LOOK LIKE THIS:
C:\Program Files\arduino-1.0.3\hardware\tools\avr\bin\avrdude -patmega2560 -cwiring “-P\\.\COM3” -b115200 -Uflash:w:apduinos-headless.hex:a “-CC:\Program Files\arduino-1.0.3\hardware\tools\avr\etc\avrdude.conf”

 

If you want to know more in detail, refer to

Source : http://www.instructables.com/id/APDuinOS-Flashing-arduino-IoT-internet-of-th/

 

This product is an example of IoT device.
Generally user can make IoT Device easily by using APDuino platform.
APDuino platform would be included in IoT category of WIZnet Museum.

APDuinOS (Flashing) — arduino IoT (internet of things) — aquaponic application
2015-08-05_APDuinOS

 

 

FIRST REASON:
Is because you know nothing about APDuinOS and interested in what it is and how it relates IoT (Internet of Things).  You can learn more about APDuino by going to http://www.apduino.org  or http://www.apduino.com for more detailed information regarding this product. In general it is a IoT developed application for aquaponics and hydroponics systems.  It has functionality as a environmental monitoring software as well.  It will also allow you to control and interact with your physical world using sensor inputs to trigger actions through an Arduino™ and/or Raspberry Pi®

SECOND REASON:
This reason is why I have written this Instructable.  It is because I am a non-technical person that wants to test and play with this concept of controlling my aquaponic units without having to be a software or firmware engineer to be effective in control of them.  This direction should allow for getting the systems I build on to the internet and control them with minimum effort, but have total control of any number of sensors and what they interact with and allow for data collection and display .

I still do not fully understand all that is going on with this application, but at least writing this instructable and being able to refer back to it as a guide will help me to duplicate this process as many times as I need to in the future.

What Is Needed —

Picture of What Is Needed --

COMPUTER:
You will need a computer of some type.  It is my understanding that APDuino can be used with Windows, Apple and Linux machines.  I only work with Windows machines and currently working with Windows 7 on a laptop.  I know nothing about Apple or Linux machines.  So this instructable might not be able to help everyone, but the concepts and steps should give you a good idea of what is needed for non-Windows machines.  How you do it, I have no idea.

SOFTWARE:
Arduino IDE 1.X
Windows Command Prompt

HARDWARE:
Arduino Mega2560
Arduino Ethernet shield with data logging function
SD card

FILES:
avrdude
avrdude.conf
apduinos-headless.hex  –  downloaded from APDuino.org

OTHER:
Ethernet connection
USB cable

 

Which Option?

Picture of Which Option?

The APDuino user guild list 3 options to accomplish getting the APDuinOS on to your arduino.

You can find the reference here:
http://apduino.org/projects/apduinos/wiki/Flashing_APDuinOS

Flashing APDuinOS
you can get a flashable APDuinOS binary in various means:

1.  get a pre-built version of APDuinOS (headless only, currently)
2.  get the library and build the demo app
3.  get the library and develop your own APDuinOS-based app

OPTION 1:
This is the option that this Inscrutable is developed for.

OPTION 2:
you would need to be an arduino expert or software engineer to pursue this option.

OPTION 3:
you would need to be an arduino expert or software engineer to pursue this option.

 

SOFTWARE — That You Will Need to Use

Picture of SOFTWARE -- That You Will Need to Use
Picture of SOFTWARE -- That You Will Need to Use
Arduino 1.x software:
You will need to have version 1.x Arduino IDE installed and running on you computer.

Arduino 1.x relates to the version of the IDE you are running on your computer.  In this Instructable I will be using arduino-1.0.3 version.  There are later versions that are downloadable and used by a larger number of people.  You should know which version you are running by looking at the directory it is installed in.

If you need help to download and install version 1 Arduino IDE here is a reference that can help you:
http://arduino.cc/en/Guide/HomePage

WINDOWS COMMAND PROMPT:  (see picture 2 as to what this looks like)
In order to “FLASH” your arduino board you will need to use this software to make the loading of the binary hex file possible.

There is one of two ways to find “Windows Command Prompt” software on your computer.

FIRST WAY:
Use Windows “RUN” function window.  To get there you will need to click on windows ICON in the start area, then select  “ALL PROGRAMS”, then select  “ACCESSORIES” menu option.  Next select the “RUN” option.  A “RUN” window will open — Type “cmd”
in the “OPEN” box  and click “OK” and the command prompt window will open.

HERE IS A VISUAL OF THE ACTIONS:

SECOND WAY:
Use  “COMMAND PROMPT ICON” selection option.  To use it you will need to click on windows ICON in the start area, then select  “ALL PROGRAMS”, then select  “ACCESSORIES” menu option.  Next select the “COMMAND PROMPT” option.  The Command Prompt window will open and you are all set.

HERE IS A VISUAL OF THE ACTIONS:

 

 

Hardware — That Will Be Needed to Use APDuinoOS

Picture of Hardware --  That Will Be Needed to Use APDuinoOS
Picture of Hardware --  That Will Be Needed to Use APDuinoOS
Picture of Hardware --  That Will Be Needed to Use APDuinoOS
Picture of Hardware --  That Will Be Needed to Use APDuinoOS

Arduino Mega2560:
This is one of the core components for setting up your APDuino API.

I have gone with an official Arduino Board to insure a successful outcome for this learning experience.  I have found I need to minimize as many variables as possible when working with new technology.  It makes it a lot easier to trouble shoot problems when I know I am working with standard components.

Here is the arduino board being used in this instructable:  (as viewed in picture 2 of this set)
http://www.amazon.com/Arduino-MEGA-2560-R3/dp/B006H0DWZW

Arduino Ethernet shield with data logging function:
This is one of the other core component for setting up your APDuino API.

I again have gone with an official Arduino Board to insure a successful outcome for this learning experience for the same reasons as above.

Here is the arduino board being used in this instructable:  (as viewed in picture 4 of this set)
http://www.amazon.com/Arduino-Ethernet-Shield-R3/dp/B006UT97FE

SD card:
I decided to go with 16GB micro SD card as it was a good value with should be enough space until I figure out how much storage will really be needed once I go fully operational with a larger scale system.  It can be viewed in picture 3 of the picture set.

http://www.amazon.com/Sandisk-16GB-MicroSDHC-Memory-Class/dp/B001F7AJKI

 

Files Needed —

Picture of Files  Needed  --
Picture of Files  Needed  --
Picture of Files  Needed  --
Picture of Files  Needed  --

In order  to accomplish the task of flashing your arduino with the APDuinOS 3 files are required and used.

Here is a discussion of them and what there function is in this process.

avrdude:
This is the file that is responsible for uploading of APDuinOS to your arduino mega2560.

This file is installed when Arduino IDE is installed.  You need to verify that the file is in fact installed (see picture 2 in the picture set).  If not, you will get an error message when you attempt to upload the APDuinOS file .  Should “avrdude” not be found uninstall Arduino IDE and reinstall until “avrdude” can be verified in the correct sub-directory.

If you want to learn more about “avr” in general here is a link with more technical details and a tutorial about this type file.
http://www.ladyada.net/learn/avr/

avrdude.conf:
This file contains configuration data used by AVRDUDE which describes the (chip) programming hardware pinouts and also provides part definitions.

AVRDUDE’s “-C” command line option specifies the location of the configuration file.

The “-c” option names the programmer  configuration which must match one of the entry’s “id” parameter.

The “-p” option identifies which part AVRDUDE is going to be programming and must match one of the parts’ “id” parameter.
(source: avrdude.conf)

This file is also installed when Arduino IDE is installed, but in a different sub-directory than “avrdude”.  You need to verify that the file is in fact installed (see picture 3 in the picture set).  If not, you will get an error message when you attempt to upload the APDuinOS.   Should “avrdude.conf” not be found uninstall Arduino IDE and reinstall until “avrdudeconf” can be verified in the correct sub-directory.

apduinos-headless.hex  –  downloaded from APDuino.org 
The most current apduinos hex file needs to be downloaded to your computer.

This file once downloaded is the file that contains the hex code that will be uploaded to the Arduino Mega2560 and allows the arduino to interact with the APDuino API.

It can be downloaded here:
http://apduino.com/firmwares?search[platform_like]=Arduino

Once downloaded “apduinos-headless.hex” needs to be located in the same sub-directory as “avrdude” 
(see picture 4 in the picture set).

 

OTHER ITEMS REQURIED

Picture of OTHER ITEMS REQURIED

Ethernet Cable or Wireless connection:
In order to download “apduino-headless.hex”  you will need a internet connection.  But everyone knows this, but just had to cover it in case there are people that are very new to all this.

USB Cable:
Will need a A type to B type to connect computer to the arduino.

 

Working With “COMMAND PROMPT” — If You Need Help

Picture of Working With

For me this has been the hardest part of the whole project.  I have worked with command prompt way back in the past and was able to get around just OK.  There is no way around flashing the arduino mega2560 without using command prompt.  So if you know how to get around with a C:> you can skip this section of the instructable.

Here is a resource for learning or refreshing your command prompt skills:
http://www.youtube.com/watch?v=7Mu9ZxUHa-w

Here are some additional resources for helping with “Command Prompt”
http://www.guidingtech.com/12909/brilliant-command-prompt-cmd-tricks/

http://www.howtogeek.com/howto/25590/how-to-enable-ctrlv-for-pasting-in-the-windows-command-prompt/

I have found the biggest help in using command prompt is knowing what it is you want to do and where you want to be on your computer.  Just take your time and concentrate on where the files you need are located and work to get there.  Once there you can accomplish your task.

In my case I need to get to where I have my “avrdude” file to start.

Here is the path command I will have to use to get to the correct directory holding the“avrdude” file.  Again my directory could be installed differently than where yours is, so make sure you know how you installed your  Arduino IDE application.

Here is the path I need to use:
C:>Program Files\arduino-1.0.3\hardware\tools\avr\bin:>

“-cwiring” VS “-cstk500v2”

Picture of
Picture of
Picture of
Picture of

Things change almost daily in the technical world.  What worked one day might not work the next time you start it up.  Versions change, systems requirement change, hardware upgrades.  Almost anything at anytime.  So as things change so do the commands we use to get things to load-up.

It is important to read the on-line documentation in the user guide for all the latest updates and follow the instructions and keep trying until you get it right.  Make sure you contact tech support at APDuino should anything not work the way the documentation talks about.  APDuino’s founder is very interested in knowing how to improve and make things better.  So let them know issues you encounter.  They will work to resolve any and all issues for you.

Here are the current notes as of this writing about differences in versions of Arduino IDE and changes needed to be tried if things don’t work at first for your version of Windows or Arduino IDE.

UPDATE: recent feedback is that using Arduino IDE 1.0.2 on Windows 7, the “-cwiring” instead of “-cstk500v2” was leading to successful upload…

Link to apduinos flashing documentation:
http://apduino.org/projects/apduinos/wiki/Flashing_APDuinOS

Going forward with Windows 8 and new Arduino IDE releases things will require new an different solutions.

SCENARIOS – to use
These scenarios will be dependent on the version of Arduino IDE that is being used and what Directory  you installed the program files in.

SCENARIO ONE:
Using “-cstk500v2”
Work with this one first then move to next one if not successful. Mine looks like this, but your PATH could be different.

It is important that all spaces, quotes and special characters are all correct in the string.  The string has been cut due to  formatting issues with this instructable, but it should be one continuous input string when done in “Command Prompt” window :

SHOULD LOOK LIKE THIS:
C:\Program Files\arduino-1.0.3\hardware\tools\avr\bin\avrdude -patmega2560 -cstk500v2 “-P\\.\COM3” -b115200 -Uflash:w:apduinos-headless.hex:a “-CC:\Program Files\arduino-1.0.3\hardware\tools\avr\etc\avrdude.conf”

SCENARIO TWO:
Using  “–cwiring”
feedback has been to use “-cwiring” with Arduino IDE 1.0.2  and higher on Windows 7.

Move to this scenario if using “-cstk500v2” was not successful for you. Mine looks like this, but your PATH could be different.

It is important that all spaces, quotes and special characters are all correct in the string.  The string has been cut due to  formatting issues with this instructable, but it should be one continuous input string when done in “Command Prompt” window :

SHOULD LOOK LIKE THIS:
C:\Program Files\arduino-1.0.3\hardware\tools\avr\bin\avrdude -patmega2560 -cwiring “-P\\.\COM3” -b115200 -Uflash:w:apduinos-headless.hex:a “-CC:\Program Files\arduino-1.0.3\hardware\tools\avr\etc\avrdude.conf”

 

If you want to know more in detail, refer to

Source : http://www.instructables.com/id/APDuinOS-Flashing-arduino-IoT-internet-of-th/

 

COMMENTS

Please Login to comment
  Subscribe  
Notify of