Weekly Progress Report Thread : Fix Bugs in BoneScript

Hi ,

This is a week 1 status update for the project : Fix Bugs in BoneScript & Improve BBUI.

Issues Fixed(till now):

I was working on fixing the issues reported at : https://github.com/beagleboard/bonescript/issues (moved from jadonk/bonescript/issues) and was able to fix these issues,

Issue #17 Interchanging digital and analog functions : First two parts of the issue was solved by the author itself , i have added a patch to perform analogWrite() on DOUT Pins here:
https://github.com/jadonk/bonescript/pull/162

Issue #34 Pin Mux Error on P8_40 : This was an issue regarding mistakes in the pin mux definition of P8_40 , i have corrected it after referring am3358 manual, here :
https://github.com/jadonk/bonescript/pull/164

Issue #24 Use module.exports instead of exports : replaced all the instances of ‘exports’ in the library with ‘module.exports’ and verified all the exported objects(also from individual files) before and after the change : https://github.com/jadonk/bonescript/pull/166

Issue #16 Handle case where debugfs not already mounted : submitted a patch to handle this case and has fixed the issue successfully here : https://github.com/jadonk/bonescript/pull/169

Issue#13 Add C Function Support : External C module support was achieved in BoneScript using Node.js add-on ‘ffi’ and some working MRAA examples(also fixed MRAA SPI Issue) were demonstrated.
Implementation : https://github.com/jadonk/bonescript/pull/170 , examples and documentation : https://github.com/vaishnav98/bonescript_ffiexamples .

Current Work :

I am presently working on PWM Issues ( Smooth PWM Implementation and [disable/enable pwm : if required]) , {Issues #30 , #26, #37}, i have tried out the patches but was not able to verify the output
as i didn’t have access to an Oscilloscope, will complete fixing the PWM issues this week itself as i have made arrangements for testing.

Issues faced this week : could not get access to an oscilloscope for testing,can solve it this week.

Next week Plan :

In the coming week i am planning to :
1)finish fixing PWM related Issues
2)Try to provide support for HCSR04 Ultrasound Sensor, generalize the solution for loading/executing PRU firmware from BoneScript
3) work on providing steps for Installing BoneScript on Snappy Ubuntu core (if required : as BeagleBone is not in the list of supported boards now (https://developer.ubuntu.com/core/get-started)

Regards
Vaishnav

Hi ,

This is a week 2 status update for the project,

Issues Fixed This week :

Issue #26 Disable PWM Output : This issue was regarding spikes occurring while writing zero duty cycle PWM, this was solved in the patch submitted here:
https://github.com/jadonk/bonescript/pull/171

Issue #30 Smooth PWM Output : This was an issue regarding occurrence of slight disturbances(sudden zero duty cycle writes) when sweeping PWM Frequencies, this was also
solved in the patch submitted here:
https://github.com/jadonk/bonescript/pull/171

Issue #17 Interchanging digital and analog functions : The last part of the feature (digitalWrite on Analog_Out) was also added in the patch submitted here:
https://github.com/jadonk/bonescript/pull/171

A test video of the PWM tests has been uploaded here : https://youtu.be/_CiSsroef18

Issue #48 Installing BoneScript on Snappy Ubuntu Core : I had tried to install bonescript on Snappy Ubuntu Core and provided documentation for installing and creating
BoneScript Snaps here https://github.com/vaishnav98/bb-blinkusr , also tried installing BoneScript on the bionic-ros image.All features work perfectly in the bionic-ros image but had to modify the library functions to work on Snappy Core(still PWM and AnalogRead doesn’t work), the modifications in the library is here : https://github.com/vaishnav98/bonescript/tree/snappy-bonescript .The example snap is available here : https://launchpad.net/bb-blinkusr

Current Work :

I am presently working on bringing PRU support to BoneScript(features are derived from https://github.com/MuneebMohammed/pypruss) and eventually demonstrate an example for reading measurements using HCSR04 Sensor(Issue #32), but was not able to complete the example demonstration as none of the available examples was working,and was not able to figure out what modifications need to be made for them to work. The firmware loading features has been implemented here : https://github.com/vaishnav98/bonescript/blob/pru-support/src/pru.js and documentation is provided here: https://github.com/vaishnav98/bonescript_pruexamples

Issues faced this week : had to spend a lot of time installing BoneScript on Snappy Core , initially i was trying on an older image and failed, but was able to install on the new image,
but some of the features(AIN,PWM…) are not working.building a snap on the beaglebone also takes a lot of time on the beaglebone , after wasting a lot of time only i could figure out
that it was passible to build it faster on launchpad.net .Also was not able to run any of the HCSR04 examples available.

Next week Plan :

In the coming week i am planning to :
1)try to demonstrate HCSR04 Sensor example
2)work on remote bonescript upload solution
3)Start Working on BeagleBone UI

Regards
Vaishnav

Hi ,

This is a week 2 status update for the project,

Issues Fixed This week :

Issue #26 Disable PWM Output : This issue was regarding spikes occurring while writing zero duty cycle PWM, this was solved in the patch submitted here:
https://github.com/jadonk/bonescript/pull/171

Issue #30 Smooth PWM Output : This was an issue regarding occurrence of slight disturbances(sudden zero duty cycle writes) when sweeping PWM Frequencies, this was also
solved in the patch submitted here:
https://github.com/jadonk/bonescript/pull/171

Issue #17 Interchanging digital and analog functions : The last part of the feature (digitalWrite on Analog_Out) was also added in the patch submitted here:
https://github.com/jadonk/bonescript/pull/171

A test video of the PWM tests has been uploaded here : https://youtu.be/_CiSsroef18

Issue #48 Installing BoneScript on Snappy Ubuntu Core : I had tried to install bonescript on Snappy Ubuntu Core and provided documentation for installing and creating
BoneScript Snaps here https://github.com/vaishnav98/bb-blinkusr , also tried installing BoneScript on the bionic-ros image.All features work perfectly in the bionic-ros image but had to modify the library functions to work on Snappy Core(still PWM and AnalogRead doesn’t work), the modifications in the library is here : https://github.com/vaishnav98/bonescript/tree/snappy-bonescript .The example snap is available here : https://launchpad.net/bb-blinkusr

The image used was just a test build. We need to coordinate with Robert to make sure it is available long term.

Hi ,

This is a week 3 status update for the project,

Work done this week :

Worked on creating a basic PocketBeagle UI and tested the features, available here : https://vaishnav98.github.io/PocketBeagle-UI/ (not fully functional when served over HTTPS,everything works well otherwise)(repository : https://github.com/vaishnav98/PocketBeagle-UI ), also worked on continuing with BBUI rewrite here : https://vaishnav98.github.io/bone101/Support/bone101/UI/ & https://vaishnav98.github.io/bone101/Support/bone101/PBUI/ (https://github.com/vaishnav98/bone101/commits?author=vaishnav98) but could not finish it on time as i was concentrating on other tasks too on the same time , i hope to finish the work on BBUI this week itself.

Also worked on creating a draft version for the remote bonescript upload feature , the server side changes are visible here : https://github.com/vaishnav98/bonescript/compare/master...vaishnav98:remote-upload and also made a Command Line Utility for configuring the setup and uploading the scripts( derived from the remotebone_test code ), available here : https://github.com/vaishnav98/bonescript_remote . The authentication part was implemented in two stages , first :all the required socket listeners were not enabled on the server until a successful authentication socket was received from the client , if the authentication was not successful the client will be disconnected after a timeout period , second :(when all socket listeners are added) on each subsequent requests an authentication event should be send from the client and only on validation other requests from client are handled and the client will be disconnected upon authentication failure after a timeout period, everything occurs as before if no security configuration is made,also added feature to enable HTTPS server if required.

also had a try on the wifi configuration part here : https://github.com/vaishnav98/bonescript/compare/master...vaishnav98:wificonfig (needs a lot of improvements) , the functions work well when tested but the configuration takes some time to complete.

Current Work : I am presently working on completing the BeagleBone User Interface work and hope to finish the work this week itself.

Issues faced this week : did not face any big issues this week , but could not finish all the tasks for the week on time ,hope to finish all the pending work along with current week’s tasks this week itself by putting in more time to work.

Next week Plan :

In the coming week i am planning to :
1)complete the work on BBUI(add BaconBits support too for the PocketBeagle UIif time permits)
2)TypeScript Definitions
3)make recommended changes to the PRU support

4)make modifications to above implementations as per feedback from mentors

Reply> Jason Kridner : i will try to spend some more time on testing the image after achieving the above goals and then send out a request mail on the general mailing list asking to make the image available long term.

Regards
Vaishnav

Hi ,

This is a week 3 status update for the project,

Work done this week :

Worked on creating a basic PocketBeagle UI and tested the features, available here : https://vaishnav98.github.io/PocketBeagle-UI/ (not fully functional when served over HTTPS,

With the new Buster images, things are served up via nginx, so we should be able add SSL. We really should add some kind of user authentication.

everything works well otherwise)(repository : https://github.com/vaishnav98/PocketBeagle-UI ), also worked on continuing with BBUI rewrite here : https://vaishnav98.github.io/bone101/Support/bone101/UI/ & https://vaishnav98.github.io/bone101/Support/bone101/PBUI/ (https://github.com/vaishnav98/bone101/commits?author=vaishnav98) but could not finish it on time as i was concentrating on other tasks too on the same time , i hope to finish the work on BBUI this week itself.

Super.

Also worked on creating a draft version for the remote bonescript upload feature , the server side changes are visible here : https://github.com/vaishnav98/bonescript/compare/master…vaishnav98:remote-upload and also made a Command Line Utility for configuring the setup and uploading the scripts( derived from the remotebone_test code ), available here : https://github.com/vaishnav98/bonescript_remote .

I will try to review in the soonest. Would be great if you could solicit any reviews. Are you trying to send scripts over to the server rather than using the built-in RPC methods? If so, I’m not a fan.

The authentication part was implemented in two stages , first :all the required socket listeners were not enabled on the server until a successful authentication socket was received from the client , if the authentication was not successful the client will be disconnected after a timeout period , second :(when all socket listeners are added) on each subsequent requests an authentication event should be send from the client and only on validation other requests from client are handled and the client will be disconnected upon authentication failure after a timeout period, everything occurs as before if no security configuration is made,also added feature to enable HTTPS server if required.

I think we don’t want to serve SSL directly, but rather use nginx. The same authentication should be useful for the RPC mechanism, such as with BBUI.

also had a try on the wifi configuration part here : https://github.com/vaishnav98/bonescript/compare/master…vaishnav98:wificonfig (needs a lot of improvements) , the functions work well when tested but the configuration takes some time to complete.

Using connman? dbus? Sorry, I’m sure a lot of this is in the code, but these emails are useful for reviews.

Current Work : I am presently working on completing the BeagleBone User Interface work and hope to finish the work this week itself.

Issues faced this week : did not face any big issues this week , but could not finish all the tasks for the week on time ,hope to finish all the pending work along with current week’s tasks this week itself by putting in more time to work.

Next week Plan :

In the coming week i am planning to :
1)complete the work on BBUI(add BaconBits support too for the PocketBeagle UIif time permits)
2)TypeScript Definitions
3)make recommended changes to the PRU support

4)make modifications to above implementations as per feedback from mentors

Reply> Jason Kridner : i will try to spend some more time on testing the image after achieving the above goals and then send out a request mail on the general mailing list asking to make the image available long term.

For Ubuntu? Would be great to use these weekly reports to make more developers aware. It isn’t obvious from the context.

BTW, another great week of development. Thanks.

Hi,

Thanks a lot for the quick review, replying to your queries :

Are you trying to send scripts over to the server rather than using the built-in RPC methods?

The functional part of this was directly derived from the remote_bonetest code : https://github.com/jadonk/bonescript/blob/master/test/TODO/remote_bonetest.js , just added an authentication event and the command-line utility.

I think we don’t want to serve SSL directly, but rather use nginx. The same authentication should be useful for the RPC mechanism, such as with BBUI.

I agree , this seems to be the better way to do it, will make the necessary modifications to current implementation.

Using connman? dbus? Sorry, I’m sure a lot of this is in the code, but these emails are useful for reviews.

this was just a trial attempt using connman only(: over the shell), the current implementation is probably not the proper way to perform the tasks , i was just having a try at this and would love to hear more from you regarding the best way to do it.

For Ubuntu? Would be great to use these weekly reports to make more developers aware. It isn’t obvious from the context.

Yes i was mentioning about spending some more time testing the Ubuntu 18.04 image , sure i will send a mail in the general mailing list before the end of Phase I mentioning the features/fixes i have finished working on , so as to make more developers aware of the work and receive feedback.

Regards
Vaishnav

Hi ,

This is a week 4 status update for the project,

Work done this week :

Worked on fixing the PWM udev delay issue : solution : using async.until method the file was repeatedly accessed(for maximum 10 times) until no EACCES error was thrown , also tested the patch and found to be functional : https://github.com/jadonk/bonescript/commit/f76e7a9fb64cab5214da658634705d4b74b9fd9d

worked on adding support for node-style callbacks : based on suggestion from @mvduin , modifications was made to support both styles of callback based on length of arguments : https://github.com/jadonk/bonescript/pull/174 , also verfied that both styles work properly using a script based on bone101 examples: https://gist.github.com/vaishnav98/bda1c2e0355e584830e8c6daf8730f93

verified and modified the typescript definition files : the draft definiton file had to modified slightly so as to follow the guidelines set by DefinitelyTyped,https://github.com/vaishnav98/DefinitelyTyped/commit/44aa2692834f98a259f029045d615e1d34fdd1a1 (will submit a pull request after review by mentors)

Added demo-pages for writeCModule and loadCModule functions here : https://github.com/vaishnav98/bone101/commit/6904981a267bf1829c5e5ac1fc2a4f17bc02efca

started work on BaconBits support for PocketBeagle UI : started working on adding BaconBits support to pocketbeagle UI but could not complete it : https://vaishnav98.github.io/BaconBits-UI/ (not functional)

Current Work : I am presently working on setting up session based authentication for the remote-bonescript upload feature.

Issues faced this week : could not finish the BBUI rewrite as it requires some more time than expected.

Next week Plan :

In the coming week i am planning to :
1)complete the work on BBUI rewrite
2)finish session based authentication for remote-bonescript upload
3)make recommended changes to the PRU support
Regards
Vaishnav

Hi ,

This is a week 5 status update for the project,

Work done this week :

Worked on fixing the dual-style callback implementation : fixed the dual style callback implementation issues, tested both offline and through rpc calls, had to modify the rpc server and client to handle the ‘callback.length’ as modifying the client alone for a translation will cause warning messages to be thrown even if the user uses nodestyle callbacks.Also fixed the rpc-test(looking at the travis-ci build logs: https://travis-ci.org/jadonk/bonescript/jobs/391540270#L2060 , i felt that the test did not run as expected even though it did not throw any errors)(also fixed the socket connection issue which caused rpc calls from browser to fail), also added more test cases to confirm the functionality of these changes and to increase the coverage.

https://github.com/jadonk/bonescript/pull/174

implemented session based authentication for rpc-server:using express-session middleware, session based basic authentication was set-up and tested both from browser and nodejs, the tests written were working well when run offline, but there is an issue that the sessions are not stored properly if the server is set-up on any other port than 80,could not look more into the issue as i discovered it only when writing the tests.

https://github.com/vaishnav98/bonescript/commit/fd181b0ac25eab879f06d11d72ff7a0930820617

worked on setting up a basic BaconBits PocketBeagle UI : starting from the pocketBeagle-UI worked on adding support for BaconBits cape, could get the RGB LED and ThumbWheel working well, the corresponding buffers for shifting out to the SPI 7-seg leds could be generated(prints on console) but shiftOut() was not working with the setup made by me using MCP23S17(could not get MCP23S18), needs to figure out the issue.

https://github.com/vaishnav98/BaconBits-UI
https://vaishnav98.github.io/BaconBits-UI/

Current Work : I am presently working on fixing the issue with rpc-server authentication and the BBUI rewrite.

Issues faced this week : had to spend some time figuring out how to send cookie data from the socket-io client, also could not figure out the BaconBits UI 7-seg led issue.

Next week Plan :

In the coming week i am planning to :
1)complete the work on BBUI rewrite
2)make recommended changes to the PRU support
3)make recommended changes to the past weeks work

4)add documentation(both through code comments and otherwise),wherever necessary for work done until this week.

Regards
Vaishnav

Hi ,

This is a week 6 status update for the project,

Work done this week :

I could not finish most of the tasks planned for this week as i fell ill and had to take rest for some days, i have recovered and will put in more time to work in the coming week so as to
make up for the lost time.

work done this week : made suggested changes to the nodestyle callback support : https://github.com/jadonk/bonescript/pull/174 and also changed the bone101 tutorials to match with the new style of callbacks : https://github.com/vaishnav98/bone101/commit/26929563c5297c842c86192154f421e497eb2066

made edits to the draft secure rpc implementation, fixed the previous issues and submitted pull request : https://github.com/jadonk/bonescript/pull/175 , also added code comments(for previously made changes) wherever necessary

submitted the typescript definitions to definitelyTyped : https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26814

Current Work : I am presently working on BBUI rewrite and adding features to PRU support.

Issues faced this week : could not dedicate enough time to work as i was not well.

Next week Plan :

In the coming week i am planning to :
1)complete the work on BBUI rewrite
2)make recommended changes to the PRU support
Regards
Vaishnav

Hi ,

This is a week 7 status update for the project,

Work done this week :

changed the rpc-authentication method to a socket.io middleware based approach, removed the use of express-session and wrote tests for the same , also modified server.js to read
configuration from /etc/default/bonescript : https://github.com/jadonk/bonescript/pull/175/commits/93e675360a2bcc987af14e749985cf75a97f646b

modified and wrote new general tests to increase code coverage : https://github.com/jadonk/bonescript/pull/175/commits/8dd9386b9e185946cc8f02076477f3f8256697ca

fix some errors(with callbacks on analogWrite() on digitalOut and digitalWrite() on analogOut) which were found while writing the above test-cases : https://github.com/jadonk/bonescript/pull/175/commits/0dbbc624bc90faf63ece04071b473c8e90eaf106 and https://github.com/jadonk/bonescript/pull/175/commits/118f3e98548aa0ebd76d63a1cb69ef651f38c9fc

worked on modifications to PRU support implementation : added compilation support : https://github.com/vaishnav98/bonescript/commit/003bb73763904f0d38e05bd7936e9b697d05fa7d (implemented using bone101 Makefile) and modified the getrpMsg to eventemitter based approach as suggested : https://github.com/vaishnav98/bonescript/commit/57d32c40f592b177db8014af4e5ebc20d60e4660

worked on BBUI : got most of the UI features of the original BBUI working after the rewrite , still need to spend more time on the rewrite to get it fully functional, also need to fix compatibility for
mobile browsers.

submitted the TypeScript definitions : https://github.com/jadonk/bonescript/pull/176

Current Work : I am presently working on adding remaining features to BBUI and adding mobile browser compatibility.

Next week Plan :

In the coming week i am planning to :
1)complete remaining work on BBUI, add mobile browser compatibility
2)make changes to previous week’s work after discussion with mentors
Regards
Vaishnav

Hi ,

This is a week 8 status update for the project,

Work done this week :

worked on BBUI : most of this week’s work was spend on completing the BBUI rewrite and was able to fix the issues with the current UI rewrite and also could replicate most of the features of the original BBUI, changes made : https://github.com/vaishnav98/bone101/commit/81be02b214e281d5c22d07d7ba57d8c204150cba

made slight changes to ffi_examples submission according to suggestion from previous review : https://github.com/vaishnav98/bone101/commit/85f0ddcdee6f7ce5c6fd820a9e4d793949949b7b

Current Work : I am presently working on adding mobile browser compatibility to the BeagleBone-UI and improving the UI graph drawing functions.

Issues faced last week: could not proceed with the full SVG UI implementation as planned since i did not have much idea on how to proceed with it.

Next week Plan :

In the coming week i am planning to :
1)fix mobile browser compatibility for BeagleBone-UI , improve the graph drawing functions,add some miscellaneous UI functions.
2)make changes to previous week’s work according to suggestions from mentors.
Regards
Vaishnav

Hi ,

This is a week 9 status update for the project,

Work done this week :

worked on BBUI : this week’s work focus was mainly on adding baconbits support to BBUI : https://github.com/vaishnav98/bone101/commit/d981d4ee64cdb0e53c2e1598711a1401e872bba6 , the changes made were,

  • add rgb led and thumbwheel support to the BaconBits-UI(tested on a prototype)

  • also added Beaglebone Green(no additional features) and Beaglebone Blue(work in progress) support to the UI

  • partly fixed the graph drawing functions

made recommended changes to the TypeScript Definitions : https://github.com/jadonk/bonescript/pull/176/commits/7c46bb0d92344736e577e2c11dd1aebe17570d13

Current Work : I am presently working on fixing the remaining issues with the graph drawing functions, also will make sure to get more people to test the UI by sending in announcements to #beagle channel.

Next week Plan :

In the coming week i am planning to :
1)fix the graph drawing functions and also complete implementing the visual feedback functions for the UI.
2)try to perform the rewrite on bonescript to remove the synchronous reads and writes for asynchronous calls .

Regards
Vaishnav

Hi ,

This is a week 10 status update for the project,

Work done this week:

This week’s work focus was was mainly on adding BeagleBone Blue support to BeagleBone UI , fixing the graph drawing functions and adding the visualization functions to the BeagleBone UI,

Next Week Plan :

In the coming week i am planning to :

1)try to perform the rewrite on bonescript to remove the synchronous reads and writes for asynchronous calls

2)prepare documentation for BeagleBone UI (and other works).

Regards
Vaishnav

Hi ,

This is a week 11 status update for the project,

Work done this week:

Issues Faced Last Week : classes have reopened for me last week, so was not possible to spend enough time towards work as expected.

Next Week Plan :

In the coming week i am planning to :

  1. finish preparing documentation for BeagleBone UI (and other works).
  2. work on the getting the rest of BBUI code merged.
  3. prepare the final presentation video
    4)work on the bonescript rewrite
    Regards

Vaishnav

Because there is not much time, it might make more sense to document in an issue the strategy for the rewrite rather than getting going on it. A small proof of concept regarding how both synchronous and asynchronous calls will work would be good. I just want to avoid open a new overly complex task rather than having good closure on an excellent summer of contribution.

Hi ,

This is a week 12 status update for the project,

Work done this week:

I could not spend much time working on the new issue this week due to my classes, however i could get these things done,

Current work: Working on the final project video

Issues Faced Last Week : could not provide a simple and consistent example for the BoneScript rewrite (to remove synchronous IO operations on Asynchronous calls) as i could not spend much time on it , i hope to provide a good example and work on the issue soon.

Work to be done :

Hi,

I am sending this message to inform that i was online on the #beagle-gsoc channel throughout today’s meeting and there was some issues with my IRC Client : I was able to see all the messages send by everyone else throughout the meeting, but it looks like no one was able to receive my messages :

It would be really helpful if mentors can have a look at this project URL and suggest any improvements : https://github.com/vaishnav98/bone101/wiki/BeagleBoard-GSoC’18:-Fixing-Bugs-in-BoneScript-and-Improving-BeagleBone-User-Interface

Also, I am working on the final project video and will upload it soon.

Regards

Vaishnav

Hi.,

Here is the project final video url : https://www.youtube.com/watch?v=94XxXs0rb7E

Regards
Vaishnav