question

kiwi35 avatar image
kiwi35 asked

GX Deported screen ?

Hello,

This question may be asked everywhere but I would like to deport GX screen on a place where I cannot pass a wire.

I have started to make some ESP32 like screen, using Modbus TCP to get data, but... On Arduino Modbus TCP cannot handle negative numbers (seems the negative numbers are.... well "not officials").

So I would like to share the code and fix it if possible, or... find other that needs to make nice way to inform the familly the status of the Multiplus GX that runs the home...

Multiplus-IIModbus TCP
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
Alexandra avatar image
Alexandra answered ·

@kiwi35

The easiest way is to use a tablet on a browser connected to the GX wifi and use the ip address. It will display everything you need there.

All code is available for download it is open source.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

kiwi35 avatar image
kiwi35 answered ·

Well I thought about that... but really... Tablet is not really a good choice.

Have already done some work on Arduino and ESP32 + TFT but negative numbers is makeing me some headaches. See pics.multi2.jpgOn battery I have :

multi1.jpg


As you see negative numbers are not threaded correctly... :(


multi2.jpg (5.7 MiB)
multi1.jpg (1.9 MiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

syfte avatar image
syfte answered ·

Here's my ModBus implementation for my van's automation system I'm building. I'm probably going to convert it to MQTT because it seems like the ModBus data isn't as accurate as the MQTT data for whatever reason. And yes, I have a pyronometer on the van :)20220218-141023.jpg


3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

kiwi35 avatar image kiwi35 commented ·

Is there any possiblity to share your code or a part of it ?

Regards

0 Likes 0 ·
syfte avatar image syfte commented ·

Are you using the ArduinoModbus library? If so, the read function only returns unsigned longs which might be why you have issues with the negative numbers.

0 Likes 0 ·
kiwi35 avatar image kiwi35 commented ·

Well I use ModbusIP_ESP8266 (since I use some ESP32 based TFT screen).

What kind of Modbus Library did you used?

0 Likes 0 ·
kiwi35 avatar image
kiwi35 answered ·

Is there any possibility of sharing your code ?

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

syfte avatar image syfte commented ·

Here's what I'm doing...

// GXS defines
#define GXDATA_INT16    1
#define GXDATA_UINT16   2
#define GXDATA_INT32    3
#define GXDATA_UINT32   4
#define GXDATA_STRING   5

// GXS vars
typedef struct GX_MODBUS_DATA {
    int id ;
    int address ;
    int type ;
    float scale ;
    float value ;
} gxModBusData ;

// -----------------------------------------------------------------------------
// Lynx Shunt (no specific ID, part of the GX device)
//           ModBusData                 ID      ADD     TYPE            SCALE   VALUE
gxModBusData shuntVoltage           = { 100,    840,    GXDATA_UINT16,  10.0,   0} ;
gxModBusData shuntCurrent           = { 100,    841,    GXDATA_INT16,   10.0,   0} ;
gxModBusData shuntPower             = { 100,    842,    GXDATA_INT16,   1.0,    0} ;

void pwrGXRead(ModbusTCPClient& client, GX_MODBUS_DATA& data) {
    float x ;
    //char string[32] ;
    if (client.connected()) {
        switch (data.type) {
            case GXDATA_INT16:
            x = int16_t(client.holdingRegisterRead(data.id,data.address)) ;
            break ;
            case GXDATA_UINT16:
            x = uint16_t(client.holdingRegisterRead(data.id,data.address)) ;
            break ;
            case GXDATA_INT32:
            x = int32_t(client.holdingRegisterRead(data.id,data.address)) ;
            break ;
            case GXDATA_UINT32:
            x = uint32_t(client.holdingRegisterRead(data.id,data.address)) ;
            break ;
            case GXDATA_STRING:
            break ;
        }
    }
    data.value = x / data.scale ;
}


0 Likes 0 ·