Web platform quick start
So you've bought a web platform and the mail man has just delivered it. What now?
Assuming you have bought your web platform from one of the Dangerous Prototypes official distributors, it will already have the ds30 bootloader installed in its dsPIC33 microcontroller. This means that you do not need a hardware programmer. Instead, you can upload your application programs direct to the web platform using the ds30 Loader application and a normal USB cable connected between your web platform and your computer.
For details of how to upload an application program to the web platform using the ds30 Loader application, see web platform firmware upgrades.
It is fairly easy to get the firmware flashed the to the 'Dangerous Prototypes/Microchip TCP/IP demo' using the ds30 Loader, then to upload the extra Microchip demo app data files to have a fully-functioning demo application. Here are some instructions (targeting Linux, but the Windows techniques are even easier!):
Since a lot of the work is done using files from the Web Platform Subversion repository, it is worthwhile 'checking out' a complete copy to you local machine. For Windows, we recommend 'Tortoise SVN' and have instructions here.
trev@shadow [projects/mchp/dp] $ svn co https://github.com/DangerousPrototypes/Web_Platform A Web_Platform/branches A Web_Platform/trunk ... A Web_Platform/trunk/software/bootloader/ds30_Loader_1.3.1-setup.exe A Web_Platform/trunk/software/bootloader/ds30loader A Web_Platform/trunk/software/bootloader/ds30loaderconsole A Web_Platform/trunk/software/bootloader/settings.xml Checked out revision 1323.
A copy of all the web platform code is now checked out to your local machine to a directory named Web_Platform in the directory from which you ran the checkout command.
Plug in the web platform using a USB cable. On Linux, the output of $ dmesg will tell you what device the USB serial port is given. Note ttyUSB0 will be found under /dev/ttyUSB0 when later typing this into ds30 loader. On Windows, you can guess the serial port, or check using Control Panel's Device Manager.
[chris@chris-desktop workspace]$ dmesg | tail [ 8030.737230] usb 5-2: Detected FT232RL [ 8030.737235] usb 5-2: Number of endpoints 2 [ 8030.737239] usb 5-2: Endpoint 1 MaxPacketSize 64 [ 8030.737243] usb 5-2: Endpoint 2 MaxPacketSize 64 [ 8030.737247] usb 5-2: Setting MaxPacketSize 64 [ 8030.739105] usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB0 [ 8030.739145] usbcore: registered new interface driver ftdi_sio [ 8030.739150] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver [ 8204.395937] lo: Disabled Privacy Extensions [ 8204.396015] SELinux: initialized (dev proc, type proc), uses genfs_contexts [chris@chris-desktop workspace]$
For Windows, navigate to the subversion directory and double click the "ds 30 Loader GUI", or for Linux, use mono to run the ds30 Loader:
[chris@chris-desktop workspace]$ mono web-platform/loader-apps/ds30\ loader\ GUI.exe
- Set the COM port to the correct /dev/tty/ device node
- Set the baud rate to 115200
- Set the Hex-file to be web-platform/firmware/MCstackDemo/dp-wp-stackdemo.v0b.hex from within our Subversion copy
- Set the Family and Device as dsPIC33FJ and dsPIC33FJ128GP204
- Press the reset button on the web platform.
- Quickly click "Download" in the ds30 Loader within a few seconds.
If the programming cycle succeeds it should look like this:
Browse to the web platform
I then checked my home ADSL router to determine (under "attached devices") what the IP address of the web platform was. In this example it is 192.168.1.3 - you will have to substitute your own device's IP address.
While you can try the "index page" of web interface - it does not load at this point. Don't worry, the device is waiting for some web content to be uploaded. Try opening your browser to http://192.168.1.3/mpfsupload - if you have the IP address correct you should see an upload screen:
Upload a demo website
If that link does not work, follow the link from the Microchip Software Libraries page to "Microchip Application Libraries", go to the bottom of the page and download Microchip Application Libraries v2010-10-19. As time goes by, you may need to choose the "Archived versions of older Microchip Application Libraries" link at the top of that page to find this version.
First unzip the download:
[chris@chris-desktop workspace]$ cd ~/Download/ [chris@chris-desktop Download]$ unzip MCHP_App_Lib_v2010_10_19_Installer.zip Archive: MCHP_App_Lib_v2010_10_19_Installer.zip inflating: Microchip Application Libraries v2010-10-19 Installer.exe [chris@chris-desktop Download]$
Then use wine to launch the installer in Linux, or double-click in Windows:
[chris@chris-desktop Download]$ wine Microchip\ Application\ Libraries\ v2010-10-19\ Installer.exe
When the installer completed (say no to the JVM install) I then moved the unpacked content out of the .wine directory where it's tricky to find, into my workspace directory:
[chris@chris-desktop drive_c]$ mv Microchip\ Solutions\ v2010-10-19/ ~/workspace/microchip
You can now use the upload web tool to upload the Microchip application demo. The path for me was ~/workspace/microchip/TCPIP Demo App/MPFSImg2.bin.
When you follow the link to "Main page" it should hopefully now show:
- If you're interested in modifying the web platform firmware, then you should read the Introduction to dsPIC33 programming. That introduction will help you start writing and compiling your own applications for the web platform.
- If you just want to get your web platform up and running a web server, then you should read the firmware introduction which provides details for uploading a program which provides a simple network test and, more importantly, turns your web platform into an EEPROM-based webserver and allows you to upload a website to it via your web browser.
- If you've successfully mastered the EEPROM-based webserver, move on to the uSD card-based webserver which stores its web pages on a micro-SD card (up to 16 GB) rather than the limited memory EEPROM (128 KB).
There is much more information available from the web platform table of contents page.
Let us know how you're using the web platform in the forum.