ESP32-WROOM-32U or ...
 
Notifications
Clear all

ESP32-WROOM-32U or Arduino UNO R4 WiFi

6 Posts
3 Users
0 Reactions
1,282 Views
(@rezafar)
Member
Joined: 2 years ago
Posts: 6
Topic starter  

Good Day to to you all,

Hope this note finds you well. As I am still fairly new in robotics, my attempt completing my 4WD robotic model has come to stall due to number of hardware/software compatibility issues.  Below is my current configuration, but haven't been able to make this bundle work together.  Unfortunately, my main issue is not being able to find the right library that would work in either environment (ESP32 / Arduino). There seem to be lot of outdated information out there. 

1 - ESP32-WROOM-32U Development Board OR Arduino uno R4 WiFi board (open to other suggestions)
2 - L298N motor controller (open to other suggestions)
4 - DC motor 1.5V – 9V 23000 RPM Brush motor
4 - Mecanum Wheels
1 – HC-SR04 (open to other suggestions)
1 – PS3 Controller OR WiFi manager

 Please Note: This is for a K9-12 project and I am also open to pay for consultation fee to make this work.

Thanks and I look forward to getting some experts opinion.

Reza.


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7728
 

Posted by: @rezafar

Good Day to to you all,

Hope this note finds you well. As I am still fairly new in robotics, my attempt completing my 4WD robotic model has come to stall due to number of hardware/software compatibility issues.  Below is my current configuration, but haven't been able to make this bundle work together.  Unfortunately, my main issue is not being able to find the right library that would work in either environment (ESP32 / Arduino). There seem to be lot of outdated information out there. 

1 - ESP32-WROOM-32U Development Board OR Arduino uno R4 WiFi board (open to other suggestions)
2 - L298N motor controller (open to other suggestions)
4 - DC motor 1.5V – 9V 23000 RPM Brush motor
4 - Mecanum Wheels
1 – HC-SR04 (open to other suggestions)
1 – PS3 Controller OR WiFi manager

 Please Note: This is for a K9-12 project and I am also open to pay for consultation fee to make this work.

Thanks and I look forward to getting some experts opinion.

Reza.

First of all, do NOT offer to pay, we are a group of hobbyists.

You have not told us what is wrong, if you can't compile, show us your source code (copy then paste into the box after pressing <>)

First use the enter key to create some blank lines (4 to 6) then move the cursor back up to the first empty line and 

Copy the first few lines in RED, it can even be a screen grab for the first post. Use the Attach Files link at the bottom for that. If instead you copied those lines, use the " tool. The box will expand as needed.

Now copy your code, and paste it into the box that opens after pressing the <> tool.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7728
 

@rezafar I assume you have looked at Bill's article at HERE and video at HERE    

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@videogame95)
Member
Joined: 4 years ago
Posts: 65
 

Hi i have installed demo code from bills video but its failing it comes up with failed I have put the eps32 this is my code what am I missing out? How do I ask bill to help as well .

/*
  ESP-NOW Demo - Receive
  esp-now-demo-rcv.ino
  Reads data from Initiator
  
  DroneBot Workshop 2022
   https://dronebotworkshop.com 
*/
 
// Include Libraries
#include <esp_now.h>
#include <WiFi.h>
 
// Define a data structure
typedef struct struct_message {

  char a[32];
  int b;
  float c;
  bool d;
} struct_message;
 
// Create a structured object
struct_message myData;
 
 
// Callback function executed when data is received
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
  memcpy(&myData, incomingData, sizeof(myData));
  Serial.print("Data received: ");
  Serial.println(len);
  Serial.print("Character Value: ");
  Serial.println(myData.a);
  Serial.print("Integer Value: ");
  Serial.println(myData.b);
  Serial.print("Float Value: ");
  Serial.println(myData.c);
  Serial.print("Boolean Value: ");
  Serial.println(myData.d);
  Serial.println();
}
 
void setup() {
  // Set up Serial Monitor
  Serial.begin(115200);
  
  // Set ESP32 as a Wi-Fi Station
  WiFi.mode(WIFI_STA);
 
  // Initilize ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }
  
  // Register callback function
  esp_now_register_recv_cb(OnDataRecv);
}
 
void loop() {
 
}



/*
  ESP-NOW Demo - Transmit
  esp-now-demo-xmit.ino
  Sends data to Responder
  
  DroneBot Workshop 2022
   https://dronebotworkshop.com 
*/
 
// Include Libraries
#include <esp_now.h>
#include <WiFi.h>
 
// Variables for test data
int int_value;
float float_value;
bool bool_value = true;
 
// MAC Address of responder - edit as required
uint8_t broadcastAddress[] = {0xC8, 0xF0, 0x9E, 0x52, 0x66, 0x44};
 
// Define a data structure
typedef struct struct_message {
  char a[32];
  float c;
  bool d;
} struct_message;
 
// Create a structured object
struct_message myData;
 
// Peer info
esp_now_peer_info_t peerInfo;
 
// Callback function called when data is sent
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
  Serial.print("\r\nLast Packet Send Status:\t");
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}
 
void setup() {
  
  // Set up Serial Monitor
  Serial.begin(115200);
 
  // Set ESP32 as a Wi-Fi Station
  WiFi.mode(WIFI_STA);
 
  // Initilize ESP-NOW
  if (esp_now_init() != ESP_OK) {
    Serial.println("Error initializing ESP-NOW");
    return;
  }
 
  // Register the send callback
  esp_now_register_send_cb(OnDataSent);
  
  // Register peer
  memcpy(peerInfo.peer_addr, broadcastAddress, 6);
  peerInfo.channel = 0;  
  peerInfo.encrypt = false;
  
  // Add peer        
  if (esp_now_add_peer(&peerInfo) != ESP_OK){
    Serial.println("Failed to add peer");
    return;
  }
}
 
void loop() {
 
  // Create test data
 
  // Generate a random integer
  int_value = random(1,20);
 
  // Use integer to make a new float
  float_value = 1.3 * int_value;
 
  // Invert the boolean value
  bool_value = !bool_value;
  
  // Format structured data
  strcpy(myData.a, "Welcome to the Workshop!");
  myData.b = int_value;
  myData.c = float_value;
  myData.d = bool_value;
  
  // Send message via ESP-NOW
  esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData, sizeof(myData));
   
  if (result == ESP_OK) {
    Serial.println("Sending confirmed");
  }
  else {
    Serial.println("Sending error");
  }
  delay(2000);
}





















   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7728
 

@videogame95 First of all you are again in someone else's Topic. You need to pick a Forum, I recommend the Help Wanted forum, then click New Topic. I have enclosed screen grabs to show you what that looks like.

Secondly, you need to do a screen grab or worst case copy the error messages here. DO NOT ATTEMPT TO TYPE THEM IN.

3rd, Bill is very busy, the chances that he will see your post is low, and he probably doesn't;t have the time.

This is a community, we are all here to help one another, Bill is the host.

I tried your code above and can see you have TWO sketches, the Receive sketch and the Transmit sketch. Separate that into two files and it will be fine.

Screenshot 2024 04 21 at 11.03.42
Screenshot 2024 04 21 at 11.03.55

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7728
 

@videogame95 I just discovered the Transmit sketch is missing the int b member from struct_message.

A far better way to do this is to create a file that both sketches include that contains the struct typedef. This way both sketches are 'seeing' the same thing.

This may be the first time you are dealing with external data rather than just global data so I understand if it is a new concept.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote