ESP32 - serial-to-serial Bluetooth - Rx/Tx an Notebook senden

English / Deutsch unten:

Hello, (Google-Translator)

I have the following problem:
From the 3kW solar inverter (which has a 9-pin serial COM port output), I want the Rx/Tx
Send data signal to my laptop using the ESP32 via bluetooth.
I connected the 3 cables, pin 2,3,5 i.e. Rx/Tx/GND, to the ESP32 module, I have this in Win8.1
Bluetooth device added and the device assigned the service: "serial connection" with a COM port.
The software for the inverter is called "WatchPower", works with the original COM cable and the
"DIGITUS USB-to-Serial" adapter flawless.
But the software does not recognize the Solar Inverter via Bluetooth. :frowning:

Therefore my questions:

  • did I install the correct Arduino sketch "serial-to-serial BT" on the ESP32 ?
  • does anything else need to be configured in the sketch?
  • have I connected the cables correctly to the ESP32? (I have already tested with Rx/Tx on Tx/Rx, GND=GND)
  • do you have to convert Rx/Tx with a TTL converter beforehand?

Please help me, ask questions if something is unclear, so we can solve the problem quickly.
I've also tried sending the data with an ESP-01 and sketch "ESP8266 wifi-serial".
In the meantime I had bought 2 devices and tried them out. "ELFIN EW10 and EW11, RS232/RS485 to WiFi".
Everything has been unsuccessful so far, and you also have to work in Windows with a virtual, serial interface via WLAN,
but in this way I get no connection at all.

Therefore, plain and simple, Bluetooth.
I hope you can help me. What am I doing wrong with the ESP32 and Bluetooth?

Many thanks in the meantime, greetings Richard

Deutsch:

Hallo,

ich habe folgendes Problem:
Ich möchte vom 3kW Solar-Inverter, (der einen 9-poligen, seriellen COM-Port Ausgang hat), das Rx/Tx
Datensignal an meinen Laptop senden, mit dem ESP32 über Bluetooth.
Ich habe die 3 Kabel, Pin 2,3,5 also Rx/Tx/GND, an das ESP32-Modul angeschlossen, habe im Win8.1 das
Bluetooth-Gerät hinzugefügt und dem Gerät den Dienst: "serielle Verbindung" mit einem COM-Port zugeordnet.
Die Software für den Inverter nennt sich "WatchPower", funktioniert mit dem originalen COM-Kabel und dem
"DIGITUS USB-to-Serial" Adapter einwandfrei.
Aber über Bluetooth erkennt die Software den Solar-Inverter nicht. :frowning:

Deshalb meine Fragen:

  • habe ich den richtigen Arduino-Sketch "serial-to-serial BT" auf den ESP32 installiert ?
  • muss in dem Sketch noch irgendwas konfiguriert werden ?
  • habe ich die Kabel am ESP32 richtig angeschlossen? (hab auch schon getestet mit Rx/Tx auf Tx/Rx, GND=GND)
  • muss man Rx/Tx vorher mit einem TTL-Konverter umwandeln?

Bitte helft mir, stellt Fragen wenn etwas unklar ist, damit wir das Problem schnell lösen können.
Ich habe auch schon versucht, mit einem ESP-01 und Sketch "ESP8266 wifi-serial" die Daten zu senden.
Ich hatte zwischenzeitlich 2 Geräte gekauft und ausprobiert. "ELFIN EW10 und EW11, RS232/RS485 to WiFi".
Alles bisher ohne Erfolg, zudem man über WLAN auch noch im Windows mit virtueller, serieller Schnittstelle arbeiten muss,
aber auf diesem Wege bekomme ich garkeine Verbindung zustande.

Deshalb, einfach und simpel, Bluetooth.
Ich hoffe ihr könnt mir weiterhelfen. Was mache ich falsch mit dem ESP32 und Bluetooth?

Vielen lieben Dank einstweilen, Gruß Richard
Ich werde nach dem Fussballspiel noch Foto posten.

Richard,

Welcome to the forum!

Be careful! RS232 serial operates at much higher voltage levels (+15v/-15v ) than the ESP (0-3.3v). Yes, you should use a serial to TTL converter to interface an Arduino/ESP with the RS232 port. I hope by already connecting it, you have not damaged the ESP32.

To be able to answer these questions, we would probably need to see the sketch?

1 Like

Hello Bitseeker, thanks for answer.
I also hope !!! :slight_smile:
Here is the original Sketch, with 1 change, the name I have changed to: Serial-To-Serial Bluetooth
and this is also exactly the name in windows devices, and if I give voltage on the ESP, is this connected, with COM 7
(see screenshot)
I missing here spoiler for the arduino code...!?


//This example code is in the Public Domain (or CC0 licensed, at your option.)
//By Evandro Copercini - 2018
//
//This example creates a bridge between Serial and Classical Bluetooth (SPP)
//and also demonstrate that SerialBT have the same functionalities of a normal Serial

#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;

void setup() {
  Serial.begin(115200);
  SerialBT.begin("Serial-To-Serial Bluetooth"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
}

void loop() {
  if (Serial.available()) {
    SerialBT.write(Serial.read());
  }
  if (SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

OK, I need to convert the RS232 signal to TTL first.
I'll do that tomorrow and then get back to you.

I'll report back, thanks in the meantime. Greetings Richard

[sterretje edit]
Fixed formatting
[sterretje end]

To the administrators of this forum:
Because I'm a newbie, I'm only allowed to post 1 photo per message... :frowning:
I personally don't think that's wise! Why:
because then the old pros in the forum come and say:
...how should we help them if we don't get enough information...
Sometimes only 1 attachment is not enough!
Then, as a newbie, you have to send a second message to tell something important.
But a 2nd message afterwards is not welcomed...:frowning:
Please reconsider and possibly expand to 3 attachments for newbies.
THANKS, greeting


Hello BitSeeker,

one more question before I start soldering the Max3232 TTL converter:
What kind of signal is that on the 6-pin white connector? (see photo)
The plug comes directly from the mainboard of the solar inverter and is on the
small circuit board to which the 8-pin RJ-45 socket is attached.
Isn't this small circuit board itself a "serial inverter" ...?
Unfortunately I could with my dig. Oscilloscope does not measure a signal.
The original COM cable supplied has 3 pins.
Here is the pinout of the cable.

RJ45 connector --> COM connector
PIN-8 = GND and is a PIN-5 on the 9-pin COM connector.
PIN-1 = Rx is a PIN-2 on the COM connector.
PIN-2 = Tx is a PIN-3 on the COM connector.

And that is also the standardized standard for the serial COM interface.
But what is really important to me is what kind of signal is on the 6-pin circuit board?

I'll post a few photos, maybe you'll see more then.
A picture says more than 1000 words...:slight_smile:

Thanks in the meantime, Gr. Richard.
Photos:

[sterretje edit]
Fixed formatting
[sterretje end]

I am not really knowledgeable on Solar Panel inverters, but I would definitely avoid trying to interface with the Tx/Rx signal on that white connector.

There is a discussion of this and (and similar other versions) of these boards here:

http://forums.aeva.asn.au/viewtopic.php?t=6007&start=25

Tx and Rx appear to be an input that drives the RS232 signal presented on the RJ45 connector, but, VIA THE TWO OPTO ISOLATORS near the center of the board. This suggests that RS232 should only be interfaced from the RJ45 port. From the discussion in the linked thread, the signal being presented still operates at around 12V.

As an example, the product here uses an RJ45 to DB9 cable to connect with a port marked 'RS232' on the product:

^12V solar panels charging kits for caravans, motorhomes, boats, yachts, marine

I imagine that since you refer to a '9-pin serial COM port output', that you have a similar cable?

In any case, it seems to me that one should not attempt to interface with Tx/Rx on that white connector at all, and that an RS232 to TTL converter will still be required to interface with the RS232 signal presented via the RJ45 port and the RJ45/DB9 cable.

I stress by way of a disclaimer, that this post is based only on my own brief research and that I am by no means knowledgeable on the subject of solar inverters so please be careful.

Maybe someone else may be along that has more detailed knowledge, but in any case, I would not attempt to connect Arduino Tx/Rx pins directly to that board.

Hello,
thanks for the info and the links. I already knew the URL, so I knew that there are x-different versions of the downstream RS232 board, and also with RJ45 or USB..

It's like you say:
The 6-pin white cable from the Mainoard is galvanically isolated by the circuit board. The Rx/Tx/GND on the RJ-45 socket have no direct connection. (measured with a multimeter and scope).
And the serial output is around 11.3 volts.
I connected a MAX3232 TTL converter to this.
But then I couldn't measure a TTL level... :frowning: Desoldered again...
Then soldered a second TTL converter because I thought the first one was broken. Also no signal.
I also programmed and tested another ESP32, nothing.
Even with the ELFIN EW-10 I didn't get any results. And if that doesn't work with an original device, then something is amiss.
A neighbor of mine, another solar inverter, didn't manage it either. There is a corona worm in the RS232! :slight_smile:

OK, I'll put the project aside for now.
Maybe I'll get an inspiration over New Year's Eve. :slight_smile:

Thanks for your help, I'll let you know if there's anything new.
Greetings Richard

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.