-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Skills Required: Intermediate at C/C++ and Beginner or higher at Javascript/CSS
Difficulty: Easy to Moderate
Challenges/Thoughts:
This pull request added the ability to use Particle cloud events like they are a "Serial" object in Arduino: #6
- Written data is sent to the cloud as the event oak/device/stdout
- Read data is sent to the Oak via the event oak/device/stdin
- Important messages about the Oaks state are sent to the cloud as the even oak/device/stderr
- System commands can be sent to the Oak via the event oak/device/reset with data "config mode", "user mode", "update mode", "reboot"
(searching these terms in the particle_core.cpp file will give you some insight - ignore #2790-2811 that was replaced by the subscribe at 3058)
Rate Limiting: Currently the code checks in the spark_process function for data to send from the buffer, this is called very frequently. There needs to be some kind of limiting functionality as the Particle cloud has a soft limit of 1 event per second per device. So this should be changed so that the buffer contents are sent no more than once every second.
Debugging: The results on the cloud seem like they might not be what is expected, this needs to be tested and the code adjusted if necessary. Using the particle cli tool particle subscribe mine can give you some good debug info - worth confirming with output from ParticleJS as well, since that tool can report with strange formatting.
HTML/JS App: Create a HTML/Javascript terminal style app to go with this functionality. This is very straightforward using the SparkJS/ParticleJS library. See the attached terminal_example.html for the specs for this.
terminal_example.zip
To test:
Install Python 2.7 and ensure it is in your path
Install the latest Oak core via board manager, download this repository and copy over the files found at APP_DATA/packages/digistump/hardware/oak/XXX where APP_DATA is where your system keeps the Arduino data and XXX is the current Oak core version.
Use a sketch the utilizes Particle.print, Particle.read, Particle.write
Make changes to the core to achieve the above task.
Connect your Oak using a 3.3v USB to Uart adapter, connect Pin2 to GND before powering on to enter Serial bootloader mode (after an upload the code with automatically run and you'll have to power cycle it to go back to bootloader mode. Disconnect Pin2 to GND to have it run the code on next power up)
ONCE: Grab OakRestore (https://github.com/digistump/OakRestore) and run python esptool.py --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x1000 blank.bin 0x2000 oaksetup_restore.bin 0x0081000 oakupdate_restore.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin replacing YOUR_COM_PORT with your com port, to restore the Oak to factory setup so that the Serial upload will work and the Oak will boot to it.
Use "Upload Using" "Serial" in the Arduino tools menu.
Upload from the IDE and test
Bounty
$100 cash or $200 credit or 20 Oaks
If you are sure you can do this, and able to do this quickly - please feel free to respond to this issue and say that you are working on it and when you will complete it, so that others don't waste their time on it. If you are just entertaining the idea/unsure if you can do it, please don't "claim" it until you are sure.
Cash or credit is your choice. Cash to be paid via Paypal. Credit has no expiration but can only be applied to a single order and does not cover shipping (because that is how our shopping cart works, not because we want to be limiting). Oaks reward includes shipping.
You may credit yourself in the files as well, leaving in tact existing licenses and credits.
Legal Stuff: We will choose a winner at our sole discretion. The winner will be the first pull request that submits fully working code meeting the above requirements and following good coding practices, based on the timestamp of the pull request. Bounty will be awarded (or in the case of Oaks, sent) within 48 hours of confirming winner. Cash awards will be made in USD. This is not an offer for hire. All work submitted becomes the property of Digistump LLC to be used at our discretion in compliance with any associated licenses. Void where prohibited by law.