-
Notifications
You must be signed in to change notification settings - Fork 2
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
SEN0359 interface with esp32 #5
Comments
I'm having the same issue. It is able to find the i2c device with this scanner:
Looking into the code I found that getDeviceInfo() returns nothing: bool DFRobot_ID809_I2C::begin()
{
...
String str = getDeviceInfo(); // <- this returns an empty string
...
} Going a bit deeper I found: String DFRobot_ID809::getDeviceInfo()
{
...
result = responsePayload(buf); // <- This is 255 which is a error
...
} uint8_t DFRobot_ID809::responsePayload(void* buf)
{
...
if (ret != ERR_SUCCESS) {
ret = ERR_ID809; // <- Throws this error
} else if (dataLen != dataCount) {
...
}
It seems to me that the readN method of DFRobot_ID809_I2C is failing to read the SDA & SCL of the ESP32. I've tested this on: The error of Nikita is caused by an ambiguous call of requestFrom which has been fixed in the master but isn't present in the library when downloading from ArduinoIDE. Even with this fix the fingerprint still doesn't work. |
This should be the problem of inconsistent wire standards. I have fixed it before, but because of the version number, you could not download that version. Now the problem has been solved. |
I did not find this problem when I tested it. Could you please use the latest updated version library for testing feedback? Thank you. |
What ESP32 did you use to check this with? Could you confirm that it works on this ESP32 This is the result of me trying it with the new 1.1.1 version that was made today. The baud rate is 9600 I've also tried this on my Arduino Uno which with the latest version(1.1.1) also doesn't seem to work.: I thought that my jumper wires might be the issue but using the same wires and switching back to 1.1.0 still works on the Arduino Uno. Running version 1.1.0 on the ESP32 however, doesn't work.
|
As shown in the figure, everything in my test is normal, uno or esp32 are fine. Have you ever tried resetting uno or esp32 after burning the sample code? I don't have enough information to find the cause of the problem. |
Strange, what specific ESP32 did you use and do you have an example of how to connect the fingerprint I2C to the esp32? |
How did you wire the fingerprint to your esp32? Do you maybe have a diagram or picture? And you used this https://www.dfrobot.com/product-2195.html esp32? |
I am facing the same issue also. I am using an Arduino Nano ESP32 and the SEN0359. I followed the wiring of the pin layout of the board for the SDA and SCL, but I still can't get a connection, getting |
Considering the similar situation of both of you, it may also be a power supply related problem. For example, the esp32 is 3.3V, the uno is 5V; And the pin current is also different, which may be related to the current provided by the computer usb port. I wonder if you can provide extra power to the esp32. |
When I was in the test using this model esp32:https://www.dfrobot.com/product-1590.html. |
If it is a power supply issue than it should've worked on my Arduino Uno R3 but it doesn't with version 1.1.1 the Uno does work with version 1.1.0 |
It's not the power supply, the code just doesn't work for our ESP32's. I've modified readN and it now works on my ESP32. |
@dylanwe I don't think this is correct. size_t DFRobot_ID809_I2C::readN(void* pBuf, size_t size)
{
uint8_t count = 0;
if (pBuf == NULL) {
LDBG("pBuf ERROR!! : null pointer");
}
uint8_t* _pBuf = (uint8_t*)pBuf;
while (size > count) {
_pWire->requestFrom(_deviceAddr, (uint8_t)1);
while (_pWire->available()) {
_pBuf[count] = _pWire->read(); // Use read() to receive and put into buf
count++;
}
}
return count;
}
size_t DFRobot_ID809_I2C::readN(void* pBuf, size_t size)
{
uint8_t count = 0;
if (pBuf == NULL) {
LDBG("pBuf ERROR!! : null pointer");
}
uint8_t* _pBuf = (uint8_t*)pBuf;
while (size > count) {
_pWire->requestFrom(_deviceAddr, (uint8_t)(((size - count) > 32) ? 32 : (size - count)));
delay(1);
while (_pWire->available()) {
_pBuf[count] = _pWire->read(); // Use read() to receive and put into buf
count++;
}
}
return count;
}
|
The begin and ending of a transmission is indeed not needed. The First sample you gave where you do requestfrom with 1 instead of 2 does work for me. In the second sample where you get 32 it stops working and gives me:
|
Thank you for the help, I'll just copy the library and change it to pull 1 byte for now. If I have more time I'll look more into why my ESP32 can only get 1 byte. |
I am working on SEN0359 with esp32 Devkit. I used the fingerprintResitration example but there is an error that is :
In file included from c:\Users\Adevair Technologies\Documents\Arduino\libraries\DFRobot_ID809_I2C/DFRobot_ID809_I2C.h:22, from c:\Users\Adevair Technologies\Documents\Arduino\libraries\DFRobot_ID809_I2C\DFRobot_ID809_I2C.cpp:12: C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h: In member function 'virtual void DFRobot_ID809_I2C::sendPacket(pCmdPacketHeader_t)': C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:127:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:125:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:127:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:125:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:127:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:125:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:127:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:125:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h: In member function 'virtual size_t DFRobot_ID809_I2C::readN(void*, size_t)': C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:127:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~~~~~~~~~ C:\Users\Adevair Technologies\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\Wire\src/Wire.h:125:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size);
I changed the wire.h library in DFRobot_ID809_I2C.h from <wire.h> to "wire.h" then it is not showing any error but output is not appearing.
Can anyone tell that what is the issue and how to solve it ?
Thank you
Nikita
The text was updated successfully, but these errors were encountered: