PLEASE NOTE: If you had an account with the previous forum, it has been ported to the new Genetry website!
You will need to reset the password to access the new forum. Click Log In → Forgot Password → enter your username or forum email address → click Email Reset Link.

Notifications
Clear all

Data logging

139 Posts
16 Users
1 Likes
2,538 Views
(@sid-genetry-solar)
Member Admin
Joined: 4 years ago
Posts: 2883
 
Posted by: @ellcon123
My 2 60A MSB's have the USB port so have connected gnd and next 2 pins to esp32. Not getting any response when I send the request code so really no idea what I sm doing wrong.

Can you show your connections from the ESP32 to the "USB" port, as well as the lines of code for setting up the UART & sending the request code?  There might be something obvious there--again, I don't have a v118 MSB, nor do I have a MSB with a "USB" port on it, so I'm not much help with info.


   
ReplyQuote
(@busky)
Trusted Member
Joined: 4 years ago
Posts: 83
 

Try this...

<fileStore.core_Attachment>/monthly_2022_12/image.png.a9fc9967e26522b05b364c03a8d397e5.png

I found this on Amazon...   The pinout seems to match even though our connector is mini usb.  So there must be some standard uart standard for USB???? (also this is upside down from our orientation)

<fileStore.core_Attachment>/monthly_2022_12/image.png.b00a68d1e45d1350d13361705ea958a6.png

 

Now mine is a 40A version but I don't imagine they would change the pinout for the 60A. 

Also not I have not tried the USB port. I was dumb enough to solder headers to where the Wifi module would go.

And I'm only 90% sure of the RX/TX (there is a small chance I swapped them)

When I did this, I didn't know the usb was connected to the uart! It would be cleaner to hack a USB cable! Maybe I'll redo this someday to use the cable..

Jim


   
ReplyQuote
(@sid-genetry-solar)
Member Admin
Joined: 4 years ago
Posts: 2883
 
Posted by: @busky
So there must be some standard uart standard for USB????

Not really...but the USB standard is +5v, D+, D-, GND.  (Mini USB adds a 5th lead for whatever reason.)

So the middle 2 leads would be the easiest RX/TX option for UART usage.

@busky Can you verify the USB "RX/TX" leads go to the same pins as the WiFi connector?


   
ReplyQuote
(@busky)
Trusted Member
Joined: 4 years ago
Posts: 83
 
Posted by: @sid-genetry-solar
Not really...but the USB standard is +5v, D+, D-, GND. (Mini USB adds a 5th lead for whatever reason.)

I didn't think so either..  But that picture was from an Amazon cable..  So someone else is using it for uart as well

 

Quote

So the middle 2 leads would be the easiest RX/TX option for UART usage.

@busky Can you verify the USB "RX/TX" leads go to the same pins as the WiFi connector?

The absolutely do.  I ohmed them out. I was not just sure 100% that I didn't mess up the RX/TX and swap them.  But I'm 95% sure I have the RX/TX correctly labeled

Jim

 


   
ReplyQuote
(@busky)
Trusted Member
Joined: 4 years ago
Posts: 83
 

https://www.amazon.com/Micro-1-64ft-Female-Tablet-Extension/dp/B08JJ1B95P

I've never seen uart signals on a usb cable..  But it matches what MSB used....


   
ReplyQuote
(@ellcon123)
Eminent Member
Joined: 2 years ago
Posts: 49
 

Here is my usb connector. I measured left most pin as gnd and then using next 2 pins for rx/tx. I think I'm just having coding issues using esphome. I'll work on it using the arduino ide in the next few days.

MSB60A3.jpg


   
ReplyQuote
(@ellcon123)
Eminent Member
Joined: 2 years ago
Posts: 49
 

I did try the unpopulated header at the top of the board 1st without luck. But if my coding is poor the it won't matter how I connect!

Screenshot_20221221_090654_Gallery.jpg


   
ReplyQuote
(@sid-genetry-solar)
Member Admin
Joined: 4 years ago
Posts: 2883
 
Posted by: @ellcon123
Here is my usb connector. I measured left most pin as gnd and then using next 2 pins for rx/tx.

I would suspect (concurring with @busky) that the RIGHTMOST pin is likely ground.  Note that it is connected to a large copper pour (often known as the "ground plane").  Leftmost pin is likely positive (+3.3 or +5.0, depending).

If you measure the 2 "RX/TX" leads separately with a meter, you should find voltage (+3.3v/5.0) on one of them, with respect to battery negative (which SHOULD be the rightmost lead).


   
ReplyQuote
(@ellcon123)
Eminent Member
Joined: 2 years ago
Posts: 49
 

Thanks. Will double check but can't do till tomorrow.


   
ReplyQuote
(@ellcon123)
Eminent Member
Joined: 2 years ago
Posts: 49
 

Just some measurements while only connected to battery. For the 4 pin header on top left of board, tx=5V and rx=1.4V. For the 5 pin mini usb, left to right, 5.3V 5.3V 5V nc gnd.

Screenshot_20221221_090654_Gallery.jpg

20221222_150616.jpg


   
ReplyQuote
(@sid-genetry-solar)
Member Admin
Joined: 4 years ago
Posts: 2883
 

So on the USB connector, I'd suggest a DMM in "DC milliamp" scale, and try shorting the suspected RX/TX leads to ground one at a time.  (Try to avoid shorting the leftmost pin, that's likely the 5v rail.)

You should get something like 15-20mA from one pin, and <1mA off the other one.

-> the 15-20mA is TX (output)

-> the <1mA is RX (input)


   
ReplyQuote
(@ellcon123)
Eminent Member
Joined: 2 years ago
Posts: 49
 

No idea what I have done differently as I have swapped the pins over and over again. Measured to gnd as you advised, tx ~40mA, reconnected and now I get a response! Only difference is gnd connected to the top left pin on the board and not thru usb. Also using resistors to drop tx to 3V.

20221226_093439.jpg


   
ReplyQuote
(@sid-genetry-solar)
Member Admin
Joined: 4 years ago
Posts: 2883
 
Posted by: @ellcon123
No idea what I have done differently as I have swapped the pins over and over again.

If you were using the leftmost USB pin as "ground", that would have referencing the TX/RX signals on the "USB port" from the wrong voltage potential.  (Technically, the serial signals as seen from the MakeSkyBlue MCU would have been 0 = 5v, 1 = 10v--quite beyond the 0-5v range of the MCU on the board.)

but that it works this way proves your code is good 😉👍


   
ReplyQuote
(@sid-genetry-solar)
Member Admin
Joined: 4 years ago
Posts: 2883
 

my guess about the ground referencing issue was from this post:

Posted by: @ellcon123
Here is my usb connector. I measured left most pin as gnd and then using next 2 pins for rx/tx.

but it appears that the rightmost pin on the "USB" connector is ground.

 

and now that it's working, your comment:

Posted by: @ellcon123
Only difference is gnd connected to the top left pin on the board and not thru usb.

...as long as you have the correct grounding potential to the MCU, it should work.

 

 

Glad to hear that comm is working on a MakeSkyBlue v118 with "USB" port.


   
ReplyQuote
(@ellcon123)
Eminent Member
Joined: 2 years ago
Posts: 49
 

Thanks for assistance. When looking at the top photo of the usb I was using right most pin as gnd. As far as I measured this was gnd. At least it's responding so I can sort out connections properly. I also have a v118 40A msb without usb so will have to look at that in the coming weeks.


   
ReplyQuote
Page 5 / 10