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

lengthMultiplikator too low for mobile sensebox #180

Open
henrymartin1 opened this issue Oct 8, 2020 · 1 comment
Open

lengthMultiplikator too low for mobile sensebox #180

henrymartin1 opened this issue Oct 8, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@henrymartin1
Copy link

Hi sensebox/blockly team,
as a arduino newbie I really appreaciated the possibility to use the blockly version to work with the sensebox. However I encountered a bug that took me some time to find and solve.

I was trying to reproduce the project for the mobile sensebox shown here: https://sensebox.de/projects/de/2020-03-09-mobilemessstation#schritt-3-%C3%BCbertragen-der-messwerte-an-die-opensensemap

My setup submitted this string

815f775f2fe6255b001bd228f1,    38.71,2020-10-08T13:44:40Z,8.xxxxxx,47.xxxxxx, 100.00

that was 84 characters long. However, the variable lengthMultiplikator is fixed to 77.

I solved the problem by calculating the lengthMultiplikator in the submitValues function.
Here is the code (be aware that I am not used to writing c code):

sprintf_P(contentBuffer, PSTR("%s,%9.2f,%s,%3.6f,%3.6f,%5.2f\n"), measurements[0].sensorId,
        measurements[0].value, timeStamp, lat, lng, altitude);
      DEBUG2("lat: "); DEBUG2(lat); DEBUG2(" long: "); DEBUG(lng);
      // transmit buffer to client
      lengthMultiplikator = strlen(contentBuffer);
@mariopesch mariopesch added the bug Something isn't working label Oct 9, 2020
@mariopesch mariopesch self-assigned this Oct 9, 2020
@mariopesch
Copy link
Member

Thanks @henrymartin1 for the issue. I'll check and fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants