-
Notifications
You must be signed in to change notification settings - Fork 0
BeagleBoard GSoC'18: Fixing Bugs in BoneScript and Improving BeagleBone User Interface
This is a Google Summer of Code 2018 project under BeagleBoard.org Foundation aimed at :
- Fixing Bugs in BoneScript reported at beagleboard/bonescript/issues
- Improving the Bone101 BeagleBone User Interface
Code : BoneScript , BeagleBone-UI (Live Preview)
Mentors : Jason Kridner, Anuj Deshpande, Michael Welling
GSoC Project Page : https://summerofcode.withgoogle.com/dashboard/project/6558422816784384/overview/
Project Final Video : TBD
Project Intro Video : https://www.youtube.com/watch?v=ZKOccMBiL5s
BoneScript is an existing Node.js library specifically optimized for the Beagle family of boards and featuring familiar Arduino function calls, exported to the browser.The primary aim of this project is to solve most of the open issues reported and add new features which will improve the user experience. The issues reported at beagleboard/bonescript/issues have been categorized into :
Project Status
Feature Requests | Suggestions/Improvements | Bugs/Compatibility Issues |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
forever to autoload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BeagleBone User Interface (BBUI) is a browser based interactive User Interface that allows a user to interact with a BeagleBone board with minimal to no coding experience, the BBUI features a drag and drop interface that allows a user to communicate to the board and use the ADC pins, digital (Inputs, Outputs, PWMs) pins, and the user LEDs on the board, the BBUI development was started from Jason Kridner's BBUI rewrite and from this GSoC '16 Project.
BoneScript library even though being widely used by BeagleBone users has some bugs and unfinished features.The primary aim of this project was to solve most of the open issues reported and add more features which will improve the User Experience.The approach followed for solving the issues are briefly described under the following topics(title for each issue links to the corresponding issue reported & the solution links to the corresponding merged pull request/commit).
These are issues that deal with requests to add some additional features to BoneScript which improves the usability of the library. These issues come under this category :-
-
Add C Module Support - This issue relates with adding support for C Modules that are compiled on the target without writing separate bindings for each function.
Solution - External C module support was achieved in BoneScript using ffi library , the documentation for the newly exposed functions and some examples are available here (also see here) -
Interchanging Analog and Digital Functions - This issue relates to adding features that make the user possible to use digital write/read functions on PWM/Analog pins and similarly analog read/write on digital pins.
Solution (also #162) - The solution was implemented as described in the issue itself:
digitalRead on AIN: if value > 0.5 then return HIGH, otherwise return LOW
analogRead on DIN: return 0 or 1 depending on digital state
digitalWrite on PWM: set duty cycle to 0 or 1
analogWrite on DOUT: if value > 0.5 then set to HIGH, otherwise set to LOW
-
HCSR04 UltraSound Sensor Support - This issue deals with adding support for HCSR04 UltraSound Sensor in BoneScript.
Solution - The issue was not completely solved as a working PRU firmware for acquiring HCSR04 sensor readings could not be found, however a general PRU firmware Loading support for BoneScript was added, the documentation for the newly exposed functions and examples are available here. -
Remote BoneScript Upload - This issue deals with adding support for remotely uploading BoneScript code to the board in a secure manner.
Solution - The Remote Script upload solution was implemented making use of the already existing BoneScript RPC Server, also a socket.io middleware based hash challenge authentication was implemented for a secure solution.The secure server can be started by creating a configuration file at the path/etc/default/bonescript
with the following contents :
{
"hash": true,
"passphrase":"9f735e0df9a1ddc702bf0a1a7b83033f9f7153a00c29de82cedadc9957289b05"(replace with your password hash SHA256),
"port": 8000 ,
"directory": "/usr/share/bone101"
}
(or)
{
"hash": false,
"passphrase":"testpassword"(replace with your password),
"port": 8000 ,
"directory": "/usr/share/bone101"
}
An example for making remote BoneScript calls and starting the secure server is demonstrated here
-
Support for Snappy Ubuntu Core - This issue relates to providing steps for installing BoneScript on Snappy Ubuntu Core and providing instructions for creating BoneScript projects as Snap Packages.
Solution - Steps for installing BoneScript and creating BoneScript Snaps on Snappy Ubuntu core were provided and tested on these images for the BeagleBone ( Ubuntu Core 16 , Ubuntu 18.04 ROS Image ) -
Smooth PWM Output - This issue relates to fixing the slight disturbances in PWM output(sudden zero duty cycle writes) that occurs while sweeping PWM frequencies.
Solution - The disturbances in PWM Output was fixed and a demonstration video for the PWM output before and after the changes is available here -
BeagleBone Blue Servo, IMU, BMP Support - This issue relates to adding support for using BeagleBone Blue I/O through BoneScript.
Solution - Support for BeagleBone Blue Servos, IMU and BMP was implemented in BoneScript after fixing the build issues and adding the additional bindings to node-roboticscape . A video demonstrating the new features is available here
These are issues that deal with suggestion/improvements tp the library. These issues come under this category :-
-
module.exports instead of exports - This issue deals with replacing the use of exports alias in BoneScript with module.exports
Solution - Replaced the use of exports with module.exports as suggested in the issue. -
Node-style Callbacks - This issue deals with supporting Node-Style Error first callbacks in BoneScript instead of the old style single object callbacks.
Solution - Added support for Node-Style error first callbacks and also retained backward compatibility for old-style callbacks by choosing the callback type based oncallback.length
property. -
Callback Documentation - This issue deals with standardizing the BoneScript callback functions and adding proper documentation for the callbacks.
Solution - After adding the support for Node-Style Callbacks, the bone101 BoneScript Documentation was modified to include a detailed documentation of the supported new style callbacks. -
TypeScript Definition - This issue deals with adding TypeScript definitions for BoneScript methods.
Solution - Starting from the TypeScript definitions written by the issue reporter, some modifications were made and the definitions were bundled with BoneScript.
-
PWM UDEV delays - This issue deals with PWM failing in User mode due to delay in setting up permissions by Udev .
Solution - Using async.js methods the corresponding file with permission issue was accessed continously until noEACCES
error was thrown, the solution works well after an average of five repeated access on the file. -
Spikes in PWM Output - This issue deals with the occurrence of random spikes in PWM output when writing zero duty cycle PWM to a pin.
Solution - when writing zero duty/frequency PWM to a pin, the output of the pin was disabled so as to suppress any occurrence of spikes in output.The spikes in PWM Output was fixed and a demonstration video for the PWM output before and after the changes is available here -
PinMux Errors - This issue deals with some errors in PinMux defintions of a pin(P8_40) in BoneScript.
Solution - The errors in the pinmux defintions for the pin was corrected after cross-checking with the AM3358 Manual. -
Handle case when debugfs not mounted - This issue deals with getPinMode() failing to fetch mux details when debugfs is not mounted.
Solution - The issue was fixed by executing the corresponding mount command on getPinMode() call, if debugfs was not already mounted. -
Analogwrite Error - This issue partially relates to analogWrite() failling due to Udev delays issue and was fixed when the Udev issue was fixed.
- Project Proposal
- Weekly Project Report Thread
- BBUI Code Documentation
- BeagleBone UI Test Video
- BeagleBone UI BeaglBone Blue Test Video
- BeagleBone UI BaconBits Cape Prototype Test Video
- node-roboticscape Servo,IMU,BMP Test video
- Creating BoneScript Snaps for Ubuntu Core
- BoneScript C Module Support : MRAA Examples
- BoneScript Smooth PWM Output Test Video
- IRC nickname: vaishnav98_ (#beagle-gsoc, #beagle)