firmata / arduino

Firmata firmware for Arduino
GNU Lesser General Public License v2.1
1.54k stars 515 forks source link

[standard mismatch] "Query Firmware" returns file name WITH extension #421

Open martin-eden opened 5 years ago

martin-eden commented 5 years ago

Hello, protocol.md says

The firmware name to be reported should be exactly the same as the name of the Firmata client file, minus the file extension. So for StandardFirmata.ino, the firmware name is: StandardFirmata.

But indeed file name is passed with extension.

I think it may be fixed by modifying extension = strstr(name, ".cpp"); to

extension = strstr(name, ".cpp");
if (!extension)
  extension = strstr(name, ".ino");

Issue present in StandardFirmata from Arduino IDE v1.8.8.

soundanalogous commented 5 years ago

I suspect this has been broken for at least 10 years.

mexchip commented 4 years ago

As stated by @soundanalogous (https://github.com/firmata/arduino/pull/433#issuecomment-547060097), removing the .ino extension might break some applications, so I think #433 should be closed and maybe this issue replaced by a new one in the protocol project (https://github.com/firmata/protocol), indicating that the firmware name keeps the .ino extension.

Or maybe don't touch the protocol docs and add this as a known issue in readme.md?

mexchip commented 4 years ago

What do you think of something like this: https://github.com/mexchip/arduino/blob/add-known-issues/readme.md#Known-issues?

(I also noticed the link to python PyMata client library was broken and fixed it)

soundanalogous commented 4 years ago

I will fix this in Firmata 3.0 which will include breaking changes. I don't think this needs to be called out specifically in the readme in the mean time. It's captured as an issue which I will keep open, I think that is sufficient.

mexchip commented 4 years ago

Ok, I've closed the pull request.