seawarrior181/PasswordPump_II

Issue with the newest CmdMessenger Library

Closed this issue · 6 comments

JVR01 commented

This error was shown while building for M0 in the Arduino IDE.

Arduino-CmdMessenger-master\CmdMessenger.cpp:492:9: error: invalid conversion from 'char' to 'char*' [-fpermissive]

492 | return '\0';

I added this small change in the library and it worked, not so elegant fix but got my PasswordPump_II running :)

The Fixed function:

char* CmdMessenger::readStringArg()
{
	if (next()) {
		dumped = true;
		ArgOk = true;
		return current;
	}
	ArgOk = false;
	
	//MIO fix
	char my_char = '\0';
	//End fix
	
	return &my_char;//orig---->return '\0';
}

Thanks for reporting the problem you encountered when using a different version of CmdMessenger. For folks who want to avoid this problem I supply the version of CmdMessenger that is used to compile the PasswordPump_II code here: https://github.com/seawarrior181/PasswordPump_II/tree/master/Libraries/PyCmdMessenger-master.zip. When you deviate from the recommended library versions you should expect to encounter problems, especially for the less frequently used libraries.

JVR01 commented

Yes Sir you're right. I did not notice you added the library (the recommended one) in the project folder. I got the CmdMessenger library from the Link found in the .ino code.

So, I suppose that was the last Version which caused the problem.

Indeed. Feel free to share with us any other modifications you're making to the source code, I am always interested in understanding what others are doing with the PasswordPump.

JVR01 commented

I definetly will try to add an erase button so that one can erase a character when a mistake is made. I also would really like to make it work with the basic raspberry RP2040, that one ist only $4 against the $14 I paid for the M0.

By the way, I installed again each library in another computer using the libraries you provided, still encounter the Error with the conversion from 'char' to 'char*:

CmdMessenger
492 | return '\0';"

work around: See my original post.
(Maybe some update in Adafruit lib for ItsyBity or Arduino caused this, Idk)

It is the second time I encounter this error with sdFat library (this was not provided by you but is required for some other lib)

Adafruit_SPIFlash.h:38:2: error: #error ENABLE_EXTENDED_TRANSFER_CLASS must be set to 1 in SdFat SdFatConfig.h
38 | #error ENABLE_EXTENDED_TRANSFER_CLASS must be set to 1 in SdFat SdFatConfig.h
| ^~~~~

work around: Do not install the one from the Repo but this one (also oficial I think): "SdFat___Adafruit_Fork-2.2.1"

I am still fascinanted by this project of yours, thanks for making it Opensource :)

Sorry for your troubles JVR1. Definitly annoying to encounter those compile time errors. Getting it working on a RP2040 (I am seeing it at $5.00 including WiFi) is a great idea, I have to admit the same thought crossed my mind (because of the cost of the M0), but I didn't pursue it. The ItsyBitsy M0 is still $11.95; I suppose you are factoring it the cost of shipping. I tend to buy them in bulk so less of an issue for me. The ItsyBitsy M0 is open source. I started looking into what it would cost to have that manufactured (to cut out Adafruit), but I'm not really confident enough in that aspect of the project to commit to having a large batch of them manufactured. Getting the cost of the PasswordPump down by using the RP2040 is an excellent idea; the ItsyBitsy M0 is the most expensive component (although the two EEprom chips are also quite expensive now, I think the cost approaches $5).

Adding a means by which to erase a character is also sorely needed. It will be tough w/o adding an additional component to the board. Perhaps an extra long click of the rotary encoder would work. I use the python app for editing credentials anyhow, that's really the best way to do it.

Best of luck to you, keep me updated on your progress and let me know if you have any questions about the code.

Dan Murphy

JVR01 commented

Thanks for your comments Dan, I really appreciate it. just wanted to share I made it compile for the RP2040 but had to make some compromises. I think the keyboard-language-choose feature is gone (It may be integrated again later).

I haven't tested yet in the breadboard and this won't happen in the next two weeks (I'll be off and will go with the Idea in mind that it's going to work :D) I'll keep you updated afterwards if it actually does.

Greetings!

Btw. I did pay 4€ for each Eeprom and 14€ for the M0 + Delivery. That was the best deal I found. Adafruit it's not that cheap in Europe.