Esp32s3 sense with PN532 from elecrow

really having not much luck with this sensor so far. I tried all the hookup possible, uart, I2C and now spi. Tried all the library you can find on the internet and the esp cant detect it.

any idea ?

i use a micro sd module with SPI as well and its works perfectly fine so the SPI communication works. The Pn532 is hooked up on same line except the SS pin which uses the D3 pin.

Hi there,
Try rolling back The BSP to the 3.0.0 beta.
HTH
GL :slight_smile: PJ :v:

bsp !? sorry, i dont understand :smiling_face_with_tear:

also, im using platformio

BSP is Board Support Package

and how would i change it with platformio and arduino framework ?
and why would it change something ?

yeah thats the module i try to use :rofl:

Hi there,
Hilarious,
You could have opened with that… :face_with_peeking_eye: It not the same as in Arduino I can assure you… LOL :face_with_hand_over_mouth:

In a nut shell , Older demo’s and some legacy LIB only work with the older ESP board support files under the boards tab in arduino. You can pull down a menu and load the older frameworks etc. from the manufactures Board Support Package. Recently ESpressif, Changed there’s to be compatible with the Newer IDF they put out. and stuck it to the Arduino IDE LOL,
Now for some demo’s they only work with the older BSP and certain LIB’s
In PLatform.io it’s done differenly if you need the older BSP to make your thing go, because it’s from a demo from 2015 :grin:

anyway @ maxgerhardt puts it better than anyone and it works very well. Here

go read the , This, This , This and This links embedded to gain GURU status. :laughing:

HTH
GL :slight_smile: PJ :v:

have you tried it in arduino to see if rolling it back makes it compile and work. Try that first is my .02
from 3.0.2 to say 2.1.7 ? :+1:

i dont really understand to be honest :upside_down_face:

i tried connecting it with I2c and with an i2c scanner i detect it but cant make it work with the library right now…

what i dont understand is : in the constructor of the object with the adafruit library you need to pass in paramater the irq pin and the reset pin. But i read that with I2c its optional. theres no way to pass the adress. how would i solve that ?

Hi there,
Post the code your using, Please use the code tags above “</>” paste it in there.
We can look , And Yes you can pass those pin assignments and is the case in allot of older code being brought forward to newer syntax. No big deal.

HTH
GL :slight_smile: PJ
:v:

good the scanner see’s it so just a matter of getting the pins correct and you can try the GPIO pin numbers instead of the logical numbers.

ie. if your using PIN 2 for example (D1) the code should reference GPIO2 if you get that.
:+1: (D2) would be GPIO3…and so on.

#include <Arduino.h>
#include <RTC_time.h>
#include "VoltageSensor.h"
#include "CurrentSensor.h"
#include "DataManip.h"
#include "WifiConnect.h"
#include "Imu.h"
#include "Tool.h"
#include <muTimer.h>
#include "Adafruit_I2CDevice.h"
#include <Adafruit_ADS1X15.h>
#include <EEPROM.h>
#include <Adafruit_PN532.h>
#include <BluetoothConnect.h>
#include <Wire.h>

// #include <Adafruit_PN532.h>
//#include "RockerSwitch.h"

#define I2C_SDA D4 //initialization ADS1015
#define I2C_SCL D5 //initialization ADS1015

const int VOLTAGE_SENSOR_PIN = A1; //analogPin 
const int CURRENTSENSOR_OUT = 0;
const int TOOLMANAGEMENT_PIN = D2; //pin used for controling behaviour of the tool //?should i put it in the cpp 


const char docuName[13] = "/pdstal.txt";
const char main_header[] = "vs_rawValue,vs_EMA_filtered,cs_rawValue,cs_EMA_filtered";
const int DATA_SAMPLING_RATE = 250;

//*all the constructor
Imu bno;
VoltageSensor vs(VOLTAGE_SENSOR_PIN,7500.0f,1000.0f);
CurrentSensor cs(CURRENTSENSOR_OUT);
Tool tl(TOOLMANAGEMENT_PIN);
muTimer mainTimer = muTimer();
Adafruit_PN532 nfc(D3,D0,&Wire);
// RockerSwitch rs(D0);

bool sd_headerWasWrittenOnce = false;
bool hasSeenWifiOnce = false ;

void setup(void) 
{
  Serial.begin(9600);
  Wire.begin(0x24);
  Wire1.begin(I2C_SDA, I2C_SCL);

  // *init all the sensors
  bno.init(); //*bno055
  vs.init(); //*voltageSensor
  cs.init(); //*currentSensor
  delay(2000);
  // sd_init(); //*sd_card module
  nfc.begin();
  

  //*init all the communication
  // wifi_init(); //*wifi 
  // initWifiConnection(ssid,password, hasSeenWifiOnce);
  // bluetooth_init(); //*bluetooth

  //*init object
  //tl.init(vs.batterySystem()); 
  
}

void loop(void)
{

What is going on here?

ahahahah, i dont know. im trying to figure it. with wire1 i use an ADS1015 for a voltage sensor.
should i use the same wire object and connect my module to the ads ?

according to what i saw the wire begin with a address is setting the unit running this code as a slave… i would assume it is the master wire 1 and wire seems to be two instances and it looks lie wire begin should pass no variables to begin in master mode

so you suggest to remove the adress in the wire.begin() ?

thats the problem with all those libs… i have no idea what is going on under the hood… also you have nothing in the main loop… i would say just go back to arduino and get the sensor communicating over IIC and take it from there

try both wire and wire1 with no variable yes i would say try that

can you send a picture of your setup

#define I2C_SDA 5 //initialization ADS1015
#define I2C_SCL 6 //initialization ADS1015

try this revision

1 Like

its not that pretty :smiling_face: