Unpacking Your New NetBurner Module
- First, go ahead and crack open the box and get a whiff of that new embedded module smell.
- Remove the Red Product Licence card. This red card contains the unique serial number you will need to create your support account and to install the software. This is a keeper… once we finish using it in this tutorial safely store it with your gold doubloons and faberge eggs.
- Upon removing the cardboard separator you will find a static-pack bag with the NNDK assembly inside. It includes a NetBurner System on a Module (SOM), also known as a Core Module, which is factory-mounted to a development board with goodies specifically designed for easier development.
- Beneath that you will find a serial cable, a mini-USB cable for power and/or serial communications, 4 rubber footing pads, and a standard Ethernet cable. If all arrived as it should have, it will look like the assortment below.
Hooking Up Your Device
- Note on static safety: Electrostatic Discharge (ESD) safeguards are never a bad idea when handling sensitive electronics. NetBurner's devices have little history of users reporting ESD damage and many users engage in little to no ESD mitigation. That said we certainly don't recommend rubbing your shoes heavily on carpet, rubbing balloon in your hair, or installing a Tesla coil nearby! An ounce of prevention is probably good practice.
- Remove the development kit from the static bag and place on your bench. Optionally, feel free to apply the rubber footing pads to the bottom of the carrier board if you like. It will just help prevent slipping and sliding of the board on your table's surface.
- Unwrap the mini-USB and Ethernet cables and connect them to the device as shown below.
Installing Netburner Software and Tools on your PC or Mac
- The Netburner Network Development Kit includes a complete suite of software, tools and documentation needed to develop an application for NetBurner hardware. To begin, let's install the software, drivers and documentation required to write an application and learn about the hardware.
- In order to download the NNDK software and tools you will need to register at https://support.netburner.com/SelfService/Tools.html. Doing this will also allow you to submit support tickets should you run into any stumbling blocks you can't quite get through. Six months of support is included with any development kit purchase. Click "New User".
- Fill in the fields as appropriate. You will need to specify the product and the NNDK Serial Number for the specific product you wish to register. That information is found on the previously unpacked Red Product Card. You can take that out of the safe for now!
- Next navigate to the link for the latest NNDK software release for your computer's OS and click "Download".
- Note: 32-bit Java Runtime Environment (JRE) 1.6 + is required.
- If you need to upgrade your JRE download it here: https://java.com/download
- After the download is complete, navigate to the downloaded installer file, open it and click the installer executable to install the software tool kit. A setup wizard will appear and then guide you through the process. Click "Next".
- Read and accept the license agreement and click "Next" to proceed.
- Read and agree to the second page of the licensing agreement. Check the applicable boxes and click "Next" to proceed.
- Select your installation directory and name. You can click on the folder icon to browse for a location. For most users the default location is recommended.
- A quick aside to users who might be upgrading their NNDK to a different version: You can have multiple versions of the NDDK installed on your machine. To do this, just rename your currently installed NNDK directory to something else. If you do not want to keep the old version around, please make sure you back up any projects you have, and then remove the old NNDK install directory completely before installing the new one. Installing over the top of an older version of the NNDK is a good way to run into all sorts of confusing and ambiguous issues. We love you too much for that.
- Click "Next".
- Next, allow the setup wizard to install the necessary driver software. Select "Yes" and then click "Next".
- In the Platform Installation Key Input screen, add the appropriate Platform type and Serial Number from the Red Card included with the product. Use the following format:
PlatformNumber:SerialNumber. If you have more than one device to register, go ahead and enter all of them in this screen. It will save you a good deal of time, and will be necessary for development if your devices are not the same model. After this you can file the Red Card someplace safe for the next year or so.
- Final chance to stop the installation. Click "Next" to proceed.
- Success! Just click "Finish" and your are done!
- It is a good idea to restart your PC at this time.
- Here's a sampling of what is included in that NNDK software:
IDE (Integrated Development Environment) used to develop, download and debug applications. Most of the below tools are also accessible through this IDE.
AutoUpdate, TCPUpdate, SerialLoad
Dowload new applciation to module (SerialLoad for MOD5213)
PC to NetBurner Serial communication
Auto-generate basic applications
Monitor applications currently running on modules
Host a TFTP Server
Send and receive UDP packets
Decipher trap messages to get source location of program faults
Documents can be found in on your PC at
/nburn/docsfolder. There you will find a variety of documentation, schematics, and guides. It's a great offline resource.
Numerous examples (over 100) can be found at
/nburn/examples. These cover using all manner of peripherals, protocols, and basic functionality, and are a fantastic starting point for your projects.
It's Alive!!! Running the Factory Application
Your first step should be to bring life into your new Dev Kit. Turning on your device, and letting it run the NetBurner factory application is like a first slap on the bum. Besides there some neat microapps in there for you to test drive.
- As per the prior steps we have already connected the Ethernet and mini-USB to the NetBurner board, install the software and restarted our PC.
- Now it's time connect the USB cable to your PC. You should see the board red power LED's become active.
- Connect the Ethernet cable to your network router, hub or switch.
- TIP: Everything is much easier if you just plug your device into the network, and don't try to connect it directly to your PC with a crossover cable. If you do that, you would need to assign a static IP, Gateway, Mask, and DNS server, and there is a lot of opportunity for failure there.
- Connect your PC to the same network. A WiFi connection to the same network should be sufficient. If you have issues try using an Ethernet cable to connect to the network.
- Open the NBEclipse application on your PC (located at
<your_nburn_install_dir>\NBEclipse). Accept the default Workspace directory on the Workspace Launcher and click "OK".
- A blank IDE window will appear. In the bottom left corner, you will find a window labeled as "NBFind". If powered on and connected to the network, your device should be listed there, along with its IP address, MAC Address, and the Application that it is running. If you do, congratulations! You just found your device. If for some reason you don't see the "FBFind" view you can enable it in "Window" > "Show View" > "NBFind". There are many other useful views you can try in there too.
- Open your favorite browser, and type in the IP address of your module where the URL goes. This should open with the default NetBurner Factory Application. If you see the the webpage below, you know that your NetBurner is working properly and serving dynamic web pages over the network. Go ahead and poke around the UI and explore the factory application.
Rolling up your sleeve to make your first project
- The factory app is a good baby step, but let's get going and show you how you can get started down the road of embedded IoT design freedom. To do this you'll need to understand how to create your first project.
- First, if it not already open, go ahead and open the NBEclipse IDE application on your PC.
- Then go to "File" > "New" > "Project".
- In the Select a wizard window choose "NetBurner" > "NetBurner Project". Click "Next".
- In the C++ Project window, type a name for your project. Select "Use default location" unless you have some other preference. In "Project type", select "NetBurner Device Executable". The default selection for "Toolchains" is "NetBurner Device", which is desired. Click "Next".
- In the Select Configurations Window, you should see the two options below checked by default. Continue by clicking "Next".
- In the NetBurner Platform Options Window, click "Search" to find your device.
- A popup window will then appear with the search results. Select your device and click "OK".
- The above steps should have you return to the previous window with the "Target Platform" and "IP Address" fields populated automatically. This will allow us to load our application on our device without any additional configuration. Click "Next".
- In the NetBurner Project Options Window, check off the options shown below. "AutoUpdate", "DHPC", and "WebServer" should be checked, then click "Finish".
- You will return to a clean project in the main NBEclipse IDE window. You will notice that there is a lot going on right off the bat in the console window on the bottom right. This is because NBEclipse will automatically build projects for you as changes to the source code are saved, which includes when it is first created.
- If you click on the project folder you'll see that a variety of project folders have been auto-populated for you. As the name would suggest,
main.cppis the primary file you would edit as you customize your application.
- Go ahead and open
main.cppand you'll see some auto generated code, as well how the Outline window helps you see the code structure. This is very helpful for longer code.
- This application is pretty boring… It literally initializes the device, starts the web server, and then does nothing. Let's add a (very) small change to give it a dash more flavor, and to make sure that we can correctly modify, build, and load our application. Inside of the main
UserMain(), you can see we've added a call to
iprintf()that will proclaim our mastery of project creation and manipulation to the world. Notice again that after you save your changes, the project is automatically rebuilt.
- Here's that code snippet:
iprintf("I did it!\r\n");
- Before we load the application, however, let's set up a serial terminal so that we can observe the output as the program restarts. Open up MTTTY, which can be found at
<your_nburn_install_dir>\pcbin. You should see a window pop up that looks a lot like the one below.
- Select the proper "Port" from the dropdown above, and hit the "Connect" button in the middle of the terminal. The default values for everything else should work just fine.
- Now, back in NBEclipse, go to the Run Button. It looks like a green play button with a downward carrot to the right of it. Select "Run as" > "2 NB Application". Because we already set the IP address of our device when configuring the project, NBEclipse can go ahead and take care of loading the application to the device. After we select "2 NB Application", a completion window should pop up briefly on the screen and fill in as the application is downloaded. It shouldn't take longer than a few seconds for it to finish and go away.
- At this point, let's return to our MTTTY terminal. We should see some startup text come up as our device boots, followed by a continual repetition of our phrase of success, "I did it!"
- If you point your browser at the device now, you should see a plain web page that says, "The main page for the MyFirstProject project." This was auto generated by NBEclipse during the project's creation, and we can change what is displayed here by modifying index.html, which is found in the html directory of the project.
- Congratulations! With those all of those steps under your belt, you now know how to turn on your device, locate it on your network, access it through a web browser, and how to create, modify, build, and load an application onto your device using NBEclipse. This is just the beginning, however. With the NetBurner's libraries and examples that come with the development kit, you can get started on anything from an FTP server, to a remotely controlled LED strip, to an Autonomous Car.