Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Linthoisana Devi Heikham
    @linthoisana
    while (errConnect == 0)
    {
    hum_temp->get_temperature(&temp_val);
    hum_temp->get_humidity(&hum_val);
        DigitalIn pir_out(PA_9, PullUp);             //PIR_OUTPUT    = PA_9
        PIR = pir_out;
        printf("HTS221: [temp] %7s C,   [hum] %s%%\r\n", print_double(buffer1, temp_val), print_double(buffer2, hum_val));
        printf("PIR: [Human_Status]    %s\r\n", PIR ? "Presence":"Absence");
    
    
        // Prepare Request payload data and calculate it's length to send to thingboard cloud.
        memset(sbuffer1, 0, sizeof(sbuffer1));
        sprintf((char*)sbuffer1, "{\"Temperature\": %s, \"Humidity\": %s, \"Human-Status\": %s}", print_double(buffer1, temp_val) , print_double(buffer2, hum_val) ,print_double(buffer3, PIR) ); 
        payload_str_len = strlen((char*)sbuffer1);
        printf("payload data len = %d : ", payload_str_len);    
    
    
    
        // Prepare Request header send to thingboard cloud.
        memset(sbuffer, 0, sizeof(sbuffer));
        // ACCESS_TOKEN = hp5sVXZjfgcl706hlHo     j(STM32_DEVICE_LIN1) / Ye2Lx6bkBYfc6nnp950g  j(STM32_DEVICE_LIN)
        sprintf((char*)sbuffer, "POST /api/v1/localservertbhw16lab/telemetry HTTP/1.1\r\nHost: 2001:db8:abcd:a:d54c:4b07:8738:9bfc\r\nContent-Type: application/json\r\nContent-Length: %d\r\n\r\n", payload_str_len); 
     //sprintf((char*)sbuffer, "POST /api/v1/localservertbhw16lab/telemetry HTTP/1.1\r\nHost: %s\r\nContent-Type: application/json\r\nContent-Length: %d\r\n\r\n", server, payload_str_len); 
        str_len = strlen((char*)sbuffer);
        printf("str len = %d, ", str_len); 
    
    
    
        // Send Request header to thingboard cloud.
        scount = my_socket.send(sbuffer, str_len);
        printf("sent data = %d : ", scount);    
        for(uint8_t cnt=0; cnt<scount; cnt++)
        {
            printf("%c", sbuffer[cnt]); 
        } 
    
        // Send Request payload data to thingboard cloud.
        uint8_t scount1 = my_socket.send(sbuffer1, payload_str_len);    
        printf("sent data = %d \n", scount1); 
        for(uint8_t cnt=0; cnt<scount1; cnt++)
        {
            printf("%c ", sbuffer1[cnt]); 
        }          
    
        // Recieve a simple http response and print out the response line
        rcount = my_socket.recv(rbuffer, sizeof rbuffer);
        printf("recv data = %d : ", rcount); 
        for(int cnt=0; cnt<rcount; cnt++)
        {
            printf("%c", rbuffer[cnt]);
        }
        //usleep(20);
        //sleep();
        wait(10);
    }
    Boris van Galvin
    @vangalvin
    haha, 3AM in the morning down here and im trying to work out why my ESP32 is not calculating the battery voltage properly from the divider network.. so this is a great break while I have yet another coffee.
    It looks to me like handler is not dealing with the IPV6 address but I could be wring.
    wrong
    Linthoisana Devi Heikham
    @linthoisana
    i hope i didnt disturb you this early morning. its 14:46 here. :D
    Boris van Galvin
    @vangalvin
    not at all :)
    Linthoisana Devi Heikham
    @linthoisana
    where can I change to make my ipv6 address work
    Boris van Galvin
    @vangalvin
    What headers are you using?
    the code you posted vanished on this end.
    Linthoisana Devi Heikham
    @linthoisana
    my program is so huge as 6lowpan is involved. i sentyou the separate file which is responsible for sending data to servers.
    Boris van Galvin
    @vangalvin

    Ok, how have you created my_socket ? that is the bit that will use the IPV6 address and open a connection to the remote server if i am not mistaken.
    once you have that then im not sure you need to pass the address in the data stream like you have...
    "POST /api/v1/localservertbhw16lab/telemetry HTTP/1.1\r\nHost: 2001:db8:abcd:a:d54c:4b07:8738:9bfc\r\nContent-Type: application/json\r\nContent-Length: %d\r\n\r\n", payload_str_len);

    unless there is a handler of some kind that builds the link based on this data then just passes the data over.

    Linthoisana Devi Heikham
    @linthoisana
    static void init_socket()
    {
    if (MBED_CONF_APP_BUTTON != NC) {
    my_button.fall(&my_button_isr);
    my_button.mode(MBED_CONF_APP_BUTTON_MODE);
    }
    nsapi_error_t open_result = my_socket.open(network_if);
    
    if (open_result != 0) 
    {
        printf("Error! socket.open(net) returned: %d\n", open_result);
    }
    
    int errConnect = my_socket.connect(server, 8080);  //"demo.thingsboard.io", 80
    while(true)
    {
        if(errConnect != 0) 
        {
            printf("Could not connect to socket : error = %d\r\n", errConnect);
            wait(60);
            errConnect = my_socket.connect(server, 8080);
            // TODO Manage connection issues here !!!!
        }
        else
        {
            printf("Socket connected\r\n");
            break;
        }
    this is how i created
    Boris van Galvin
    @vangalvin
    Awesome.. now if you rem out the part that sends the data is that actually making a connection to the server?
    Linthoisana Devi Heikham
    @linthoisana
    yes it does make connection to the server..
    and the server sends me back 400 error
    Linthoisana Devi Heikham
    @linthoisana
    only the local server sends me back http 400 and connection gets close. while the code works perfectly fine in my remote server demo.thingsboard.io
    Boris van Galvin
    @vangalvin
    400 = bar request so the server is rejecting something that you are sending.
    what you need to do is rem out all of the bits of code that send data with the exception of the code that builds the socket. then see if it gives you a 400 error. if it does then look in the thingsboard log. open up a windows power shell, go to where thingsboard is storing its log and run Get-Content thingsboard .log -Tail 10
    really? is the remote server windows based as well?
    400 = bad request not bar.. lol..
    Linthoisana Devi Heikham
    @linthoisana
    yes, i mean, sometime i check in my phone too for remote server and i get the datas,
    generally, for remote server, we can check in any browser in our thingsboard.io account
    Boris van Galvin
    @vangalvin
    OK, then the issue is not with the code then. definatly run "Get-Content thingsboard .log -Tail 10" and see what is in there. that will tell you what the local server is having issues with.
    Linthoisana Devi Heikham
    @linthoisana
    "Get-Content thingsboard .log -Tail 10" is not recognized as an internal or external operable program or batch file
    i ran in command promt as adminstrator
    Boris van Galvin
    @vangalvin
    you need to run that in powers shell
    without the quotes on windows 10
    and the log file is normally located in C:\Program Files (x86)\thingsboard\logs
    Boris van Galvin
    @vangalvin
    hope that helps, i need to go get some sleep. may be back on tomorrow if you don't sort it and if you still need a hand.
    StartCPE
    @StartCPE
    hello
    thingsboard postgres active (exited) how to check and fixed
    Linthoisana Devi Heikham
    @linthoisana
    @vangalvin sorry for late reply but i had to leave my university lab. maybe tomorrow,i will wait for your reply.
    @vangalvin thank you for your help today, i will ping you again here if it doesnt work.
    StartCPE
    @StartCPE
    hello i used postman for send telemetry data to device
    postman http code 200ok but i dont see telemetry data on device

    hello i used postman for send telemetry data to device
    postman http code 200ok but i dont see telemetry data on device

    how to fixed it?

    Linthoisana Devi Heikham
    @linthoisana
    @vangalvin : I checked running in powershell adn it shows me .: Get-Content: A positional parameter cannot be found that accepts argument '10'
    @vangalvin : and i can see the log folder in the directory given C:\Program Files (x86)\thingsboard\logs
    Marius Sittig
    @Kerruan
    Heyho, how do I add a timeseries (from an external api like openweather api) to an entity(asset) in thingsboard?
    amizer12
    @amizer12
    For a way to code button that sends rpc to device
    i’m able to send a specific command and turn it on but only this
    What variable stores the state so i can use it in action code and send everytime the opposite value
    any ideas ?
    Boris van Galvin
    @vangalvin
    Is there a way to just present the dashboard? for instance If i wanted a dashboard to become public and display it to anyone without any of the menu interface/information.
    Linthoisana Devi Heikham
    @linthoisana
    May I know whats the header size thingsboard server accepts using HTTP protocol?
    BernhardHaider
    @BernhardHaider
    Hi, i cannot make new web camera input widget working. it always tells me "no support web camera". maybe someone knows a working example
    Shivaratn
    @Shivaratn
    Is there a way to find the number of devices based on the number of relations created on the gateway device programmatically or using rule engine?
    nmahale10
    @nmahale10
    hi
    how to use " var.input" in msg. var.input in Rule Engine JS
    aimette
    @aimette
    @ashvayka I am playing around with HTTP integrations and converters (Professional edition) for backwards compatibility with my current product. I am currently uploading batched data from several devices once every 2 seconds. Each device collects a new datapoint twice per second. Everything is working fine - except alarms. I receive multiple alarms from a single event. Only a single alarm appears in the alarm widget, but the telegram app receives multiple notifications. The "create alarm" node is generating multiple alarms with relation "created", even though the second, third, etc alarm are not new, they should have the relation "updated". Is this the expected behaviour for using converters/integrations with batched data? Is there a way around it? I have already tried the create alarm tutorial, I've followed this thingsboard/thingsboard#717 and I have manually set the "isNewAlarm = false".
    Roen Ylagan
    @roenylagan
    Hello all, can I have multiple tb-gateway connected to a gateway device in thingsboard?
    Shannon Olivier
    @Shannon04_gitlab
    Hi guys. So I set up my server for Trendz Analytics. Did anyone manage to find any documentation on how to install the actual software?
    Dark-Angel
    @Dark-Angel0813
    Hello all , I am unable to connect two tb-gateways to thingsboard. Each gateway is assigned to a different tenant. When I run them simultaneously the gateways are unable to send data in realtime and eventually they fail. Any kind of help is appreciated