Mervis EnOcean



  • Hi,
    We can see, in Mervis IDE, a channel protocol as EnOcean.
    Do you know an USB comptatible dongle with Mervis and Raspberry unipi 1.1.
    How that works and how to connect new devices and communicate with them ?


  • administrators

    @Giamba We are currently (and only for Neurons) testing TCM310 which is connected to UART of RPi, so you could try that one....

    Just remember that currently Mervis supports only reading of some of the sensors and not writing to the EnOcean network.



  • Thank for your response.
    So is that possible to send values to modbus channel ?
    Maybe à modbus server to put values and modbus channel to read ?
    I can make a program that do the stuff in C.

    Giamba


  • administrators

    @Giamba I am not sure how do you mean it right now... Could you explain it please?



  • Sorry Tomas,
    So in your fisrt post, i understand we can read if a button is pressed but we can't set on/off a receiver module as the FSB61NP-230V for example.
    But is there a way to read values from mervis by another program via modbus protocol ?
    Today I know how to read values from another program via modbus and parse them with Mervis, but is it possible to do the opposite ?
    If I find the way to do that, I will be able to make a program wich interface the UART with MERVIS via modbus protocol on TCP.
    Thanks


  • administrators

    @Giamba thanks for clearing it up! Yes, that is pretty much how we recommend users to interface Mervis data. Making a TCP Modbus Server or Client is pretty easy in Mervis and you can map any internal variable to a register or coil. So if you know how to write another application to run beside Mervis and handle the communication from UART/USB and TCP Server/Client than you are good to go.



  • Thank you for these explanations.
    Now, there is one more thing I do not understand. When I look at the Port Monitor in Mervis IDE, the frame sent is "07 20 00 00 00 09 00 10 00 00 00 01 02 01 00" or "07 14 00 00 00 06 00 03 00 00 00 08". First, why is the length of the two chains not the same?
    Secondly, from my program, when I display the RPI modbus request, the string looks like this while in my I / O, I have only 1 variable in the "write" group in "writeonly" mode. So where is my variable in this frame?
    thanks again

    00 05 00 00 00 06 00 03 00 00 00 08 F8 D8 87 7E B4 3A FE 76 00 00 00 00 30 D1 FD 76 01 00 00 00 00 00 00 00 01 00 00 00 58 FB FD 76 00 00 00 00 00 00 00 00 CF DC 87 7E 08 43 FB 76 00 00 00 00 00 0F 01 00 00 00 00 00 10 FD FD 76 68 35 FE 76 D0 DB 87 7E FF FF FF FF B8 37 FB 76 D0 E2 F9 76 50 1C FE 76 24 D9 87 7E 78 7C FB 76 00 00 00 00 00 00 00 00 00 00 00 00 00 30 FB 76 C0 37 FB 76 20 00 03 00 44 33 FB 76 08 7F FB 76 00 00 00 00 58 FB FD 76 00 90 D7 76 48 50 02 00 C0 C4 FD 76 00 00 00 00 0C 00 00 00 E8 BB DB 76 00 00 00 00 FC 9B DB 76 88 D9 87 7E 8C D1 FB 76 01 00 00 00 E8 BB DB 76 0C 00 00 00 98 2D FE 76 00 00 00 00 08 7F 89 05 00 30 FE 76 98 2D FE 76 20 DA 87 7E 60 08 FD 76 BC 38 FE 76 38 EF FC 76 00 00 00 00 00 00 00 00 01 00 00 00 A5 00 00 00 40 D1 FD 76 88 F5 FD 76 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 39 32 2E 35 00 00 00 30 2E 30 00 48 DA 87 7E 30 2E 30 00 0C 00 00 00 32 34 2E 30 00 00 00 00 32 35 2E 38 00 DA 87 7E 36 35 2E 30 00 30 FE 76 35 30 2E 30 00 00 00 00 31 30 32 35 2E 30 00 00 57 4D 52 32 30 30 5F 55 53 42 00 76 03 00 00 00 FF FF FF FF 0C 00 00 00 20 9A A9 00 08 78 A9 00 50 60 A9 00 08 60 A9 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 02 DD 76 00 50 EF 76 D4 DB 87 7E 01 00 00 00 A8 15 01 00 B0 EC FD 76 88 F5 FD 76 00 00 00 00 00 00 00 00 00 0F 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 FE 76 00 00 00 00 68 C7 49 D2 B8 1F 13 DA 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 3B FE 76 00 A0 C8 76 18 42 0D 00 FF FF FF FF C8 F2 FD 76 28 3E DC 76 88 F5 FD 76 C0 C4 FD 76 00 00 00 00 D8 A3 EF 76 01 00 00 00 00 00 00 00 B8 23 FC 76 60 EE FD 76 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 58 39 FE 76 00 00 00 00 24 21 02 00 C0 C4 FD 76 00 00 00 00 64 07 01 00 01 00 00 00 00 00 00 00 B8 23 FC 76 B0 EC FD 76 01 00 00 00 01 00 00 00 00 00 00 00 F0 43 01 00 28 3E DC 76 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 FE 76 50 8F FC 76 00 00 00 00 00 00 00 00 00 0F 01 00 00 00 00 00 00 00 00 00 2C 0F 01 00 84 1C 01 00 08 34 FC 76 D4 DB 87 7E E3 DC 87 7E 00 00 00 00 75 DD 87 7E 89 DD 87 7E AA DD 87 7E B4 DD 87 7E BC DD 87 7E C7 DD 87 7E D4 DD 87 7E E1 DD 87 7E EB DD 87 7E FD DD 87 7E 08 DE 87 7E 5C DE 87 7E 78 DE 87 7E 89 DE 87 7E 99 DE 87 7E 11 DF 87 7E 44 DF 87 7E 56 DF 87 7E 00 00 00 00 21 00 00 00 00 E0 89 7E 10 00 00 00 D6 B0 3F 00 06 00 00 00 00 10 00 00 11 00 00 00 64 00 00 00 03 00 00 00 34 00 01 00 04 00 00 00 20 00 00 00 05 00 00 00 08 00 00 00 07 00 00 00 00 30 FB 76 08 00 00 00 00 00 00 00 09 00 00 00 00 0F 01 00 0B 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 0D 00 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 17 00 00 00 00 00 00 00 19 00 00 00 CF DC 87 7E 1A 00 00 00 00 00 00 00 1F 00 00 00 6A DF 87 7E 0F 00 00 00 DF DC 87 7E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 17 96 F9 2E E8 1D CE AC 71 9D E2 91 6F 69 49 3D 76 37 6C 00 2F 72 6F 6F 74 2F 2E 6E 65 74 62 65 61 6E 73 2F 72 65 6D 6F 74 65 2F 31 39 32 2E 31 36 38 2E 31 2E 32 34 32 2F 6A 62 5F 70 63 2D 57 69 6E 64 6F 77 73 2D 78 38 36 5F 36 34 2F 43 2F 55 73 65 72 73 2F 4A 65 61 6E 2D 42 61 70 74 69 73 74 65 2F 44 6F 63 75 6D 65 6E 74 73 2F 4E 65 74 42 65 61 6E 73 50 72 6F 6A 65 63 74 73 2F 4D 6F 64 62 75 73 5F 32 2F 64 69 73 74 2F 44 65 62 75 67 2F 47 4E 55 2D 4C 69 6E 75 78 2F 6D 6F 64 62 75 73 5F 32 00 4D 41 49 4C 3D 2F 76 61 72 2F 6D 61 69 6C 2F 72 6F 6F 74 00 53 53 48 5F 43 4C 49 45 4E 54 3D 31 39 32 2E 31 36 38 2E 31 2E 37 33 20 35 30 36 32 39 20 32 32 00 55 53 45 52 3D 72 6F 6F 74 00 53 48 4C 56 4C 3D 31 00 48 4F 4D 45 3D 2F 72 6F 6F 74 00 4F 4C 44 50 57 44 3D 2F 72 6F 6F 74 00 4C 4F 47 4E 41 4D 45 3D 72 6F 6F 74 00 5F 3D 2F 62 69 6E 2F 73 68 00 58 44 47 5F 53 45 53 53 49 4F 4E 5F 49 44 3D 63 32 00 54 45 52 4D 3D 78 74 65 72 6D 00 50 41 54 48 3D 2F 75 73 72 2F 6C 6F 63 61 6C 2F 73 62 69 6E 3A 2F 75 73 72 2F 6C 6F 63 61 6C 2F 62 69 6E 3A 2F 75 73 72 2F 73 62 69 6E 3A 2F 75 73 72 2F 62 69 6E 3A 2F 73 62 69 6E 3A 2F 62 69 6E 3A 2F 75 73 72 2F 62 69 6E 3A 2F 75 73 72 2F 6C 69 62 00 58 44 47 5F 52 55 4E 54 49 4D 45 5F 44 49 52 3D 2F 72 75 6E 2F 75 73 65 72 2F 30 00 4C 41 4E 47 3D 66 72 5F 46 52 2E 55 54 46 2D 38 00 53 48 45 4C 4C 3D 2F 62 69 6E 2F 62 61 73 68 00 50 57 44 3D 2F 72 6F 6F 74 2F 2E 6E 65 74 62 65 61 6E 73 2F 72 65 6D 6F 74 65 2F 31 39 32 2E 31 36 38 2E 31 2E 32 34 32 2F 6A 62 5F 70 63 2D 57 69 6E 64 6F 77 73 2D 78 38 36 5F 36 34 2F 43 2F 55 73 65 72 73 2F 4A 65 61 6E 2D 42 61 70 74 69 73 74 65 2F 44 6F 63 75 6D 65 6E 74 73 2F 4E 65 74 42 65 61 6E 73 50 72 6F 6A 65 63 74 73 2F 4D 6F 64 62 75 73 5F 32 00 53 53 48 5F 43 4F 4E 4E 45 43 54 49 4F 4E 3D 31 39 32 2E 31 36 38 2E 31 2E 37 33 20 35 30 36 32 39 20 31 39 32 2E 31 36 38 2E 31 2E 32 34 32 20 32 32 00 4F 4D 50 5F 4E 55 4D 5F 54 48 52 45 41 44 53 3D 32 00 53 50 52 4F 5F 45 58 50 41 4E 44 5F 45 52 52 4F 52 53 3D 00 2F 72 6F 6F 74 2F 2E 6E 65 74 62 65 61 6E 73 2F 72 65 6D 6F 74 65 2F 31 39 32 2E 31 36 38 2E 31 2E 32 34 32 2F 6A 62 5F 70 63 2D 57 69 6E 64 6F 77 73 2D 78 38 36 5F 36 34 2F 43 2F 55 73 65 72 73 2F 4A 65 61 6E 2D 42 61 70 74 69 73 74
    

  • administrators

    @Giamba
    ad 1) these are completely different requests, the first one writes multiple registers, the second one reads some of them.. What are they connected to?
    ad 2) It is hard to decode but I think that the string contains multiple requests so it is hard to decode...

    Check http://modbus.rapidscada.net/



  • Hi,
    So I add a modbus server to my PLC, with a device and one mapped variable (integer).
    The device's adresse is 0, device's IP 192.168.1.240 and port 1503.
    My client code:

    #include <stdio.h>
    #ifndef _MSC_VER
    #include <unistd.h>
    #endif
    #include <string.h>
    #include <stdlib.h>
    #include <errno.h>
    
    #include <modbus.h>
    
    
    int main(void)
    {
        modbus_t *ctx;
        int rc;
        uint16_t *tab_reg;
        int i;
        int nb;
        int startAddr;
    
        /* TCP */
        ctx = modbus_new_tcp("192.168.1.240", 1503);
        modbus_set_debug(ctx, TRUE);
    
        if (modbus_connect(ctx) == -1) {
            fprintf(stderr, "Connection failed: %s\n",
                    modbus_strerror(errno));
            modbus_free(ctx);
            return -1;
        }
    
        startAddr = 0;
        nb = 1;
        
        tab_reg = (uint16_t *) malloc(nb * sizeof(uint16_t));
        memset(tab_reg, 0, nb * sizeof(uint16_t));
    
        //while (1) {
            rc = modbus_read_registers(ctx, startAddr, nb, tab_reg);
            if (rc == -1) {
                fprintf(stderr, "%s\n", modbus_strerror(errno));
                //return -1;
            }
    
            //for (i=0; i < rc; i++) {
            //     printf("reg[%d]=%d (0x%X)\n", i, tab_reg[i], tab_reg[i]);
            // }
       // }
    
        /* Free the memory */
        free(tab_reg);
    
        /* Close the connection */
        modbus_close(ctx);
        modbus_free(ctx);
    
        return 0;
    }
    

    I got this error:
    ERROR Connection reset by peer: read
    Connection reset by peer
    Can you tell me what's happening ?
    Thanks fo all !



  • Ok,
    Just to add the device Id.

    modbus_set_slave(ctx, 1);
    

    Thanks for all, now I can make all what I want with Mervis .

    Giamba