Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to export Arduino code for a registered site #7

Closed
horsburgh opened this issue Feb 2, 2017 · 5 comments
Closed

Add ability to export Arduino code for a registered site #7

horsburgh opened this issue Feb 2, 2017 · 5 comments
Assignees
Milestone

Comments

@horsburgh
Copy link
Member

horsburgh commented Feb 2, 2017

Once a user has registered a site and added sensors to it, add a button to the site details/registration page that exports a code block with the following:

  • SamplingFeatureUUID
  • Time zone/UTCOffset Information
  • SecurityToken
  • ResultUUIDs for any attached sensors

This would enable us to use standardized code for the rest of the Arduino code, but the users can paste this code into the standard code. Still need to define exact content and format of the code that is exported.

@fryarludwig
Copy link
Member

We'll be basing the snippet generator off this .ino file:
https://github.com/EnviroDIY/ModularSensors/blob/master/examples/logging_to_EnviroDIY/logging_to_EnviroDIY.ino

@fryarludwig fryarludwig self-assigned this Mar 23, 2017
@SRGDamia1
Copy link
Member

@fryarludwig, please let me know if there's anything in that .ino that you don't understand!

fryarludwig added a commit that referenced this issue Apr 2, 2017
@fryarludwig
Copy link
Member

fryarludwig commented Apr 2, 2017

As of my latest push, the devices page creates code that has each of the device's and sensors' UUIDs (see screenshot below). This is far from a full .ino file generator, but there are enough challenges (pins used, calibration values, header includes, and sensor initialization) that reliably generating full files would optimistically take about a week.

To generate the full .ino file, we would need to gather all of the sensor class names and constructors from the sensor repository, know which sensors require which pins and which calibration values (we could leave these blank for the user to fill in), and assume serial port details. We would also need a way to handle new sensors that are added after the release of this tool. There would still be a lot of values for the user to fill in, but it may save enough time to be useful. What's the group consensus on this? (We could also wait on the full .ino file generator for a later release, if there are higher priorities right now)

image
Edit: The UUIDs in the screenshot are not the actual values and won't work.

@horsburgh
Copy link
Member Author

@fryarludwig - rather than displaying the code on the page, let's add a button that opens a modal window.

@SRGDamia1 and @aufdenkampe - I think we probably need some feedback from you guys on this.

@aufdenkampe
Copy link
Member

@fryarludwig, thanks for all this hard work! What you just showed looks like a great help, and I'm leaning toward releasing the next version based on just generating the code snippets with the UUIDs and leaving the full .ino generation for a later release, because, as you point out, @SRGDamia1 and I will need to do some work to provide additional information about the pin configurations for each sensor, etc.

I also agree that there may be some higher priority issues to work on, which you could do in parallel to the our work.

Let's meet this week to discuss next steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants