text:
HOW TO COMBINE TWO CODES to send gps data to BROKER

HELLO THERE,
I'm Trying to send GPS data through MQTT to the broker test.mosquitto.org,
can anyone tell me how to combine these codes, how can I send variable GPS data in PUBLISH_PAYLOAD
CAN ANYONE GUIDE ME?
@Neutree
THANK YOU.

I have tried the same, but had no succes.
here is my code:
#include "stdbool.h"
#include "stdint.h"
#include "stdio.h"
#include "string.h"

#include "api_os.h"
#include "api_debug.h"
#include "api_event.h"
#include "api_mqtt.h"
#include "api_network.h"
#include "api_socket.h"

#include <string.h>
#include <api_gps.h>
#include <api_event.h>
#include <api_hal_uart.h>
#include "gps_parse.h"
#include "math.h"
#include "gps.h"

#define BROKER_IP  "scheufele.ddns.net"
#define BROKER_PORT 1883
#define CLIENT_ID  "gprs"
#define CLIENT_USER ""
#define CLIENT_PASS ""
#define SUBSCRIBE_TOPIC "app"
#define PUBLISH_TOPIC   "gps"
#define PUBLISH_INTERVAL 5000

#define MQTT_TASK_STACK_SIZE    (2048 * 2)
#define MQTT_TASK_PRIORITY      2
#define MQTT_TASK_NAME          "Main Test Task"

#define SECOND_TASK_STACK_SIZE    (2048 * 2)
#define SECOND_TASK_PRIORITY      3
#define SECOND_TASK_NAME          "MQTT Test Task"

#define GPS_TASK_STACK_SIZE    (2048 * 2)
#define GPS_TASK_PRIORITY      1
#define GPS_TAST_NAME          "GPS Test Task"

static HANDLE gpsTaskHandle = NULL;
bool flag = false;
bool isGpsOne = true;

static HANDLE mainTaskHandle = NULL;
static HANDLE secondTaskHandle = NULL;

static HANDLE semMqttStart = NULL;

char publish_payload[300] = "Hier wird die GPS-Information stehen.";
char buffer[300];

typedef enum{
    MQTT_EVENT_CONNECTED = 0,
    MQTT_EVENT_DISCONNECTED ,
    MQTT_EVENT_MAX
}MQTT_Event_ID_t;

typedef struct {
    MQTT_Event_ID_t id;
    MQTT_Client_t* client;
}MQTT_Event_t;

typedef enum{
    MQTT_STATUS_DISCONNECTED = 0,
    MQTT_STATUS_CONNECTED       ,
    MQTT_STATUS_MAX
}MQTT_Status_t;

MQTT_Status_t mqttStatus = MQTT_STATUS_DISCONNECTED;

static void EventDispatch(API_Event_t* pEvent)
{
    switch(pEvent->id)
    {
        case API_EVENT_ID_NO_SIMCARD:
            Trace(1,"!!NO SIM CARD%d!!!!",pEvent->param1);
            break;

        case API_EVENT_ID_SYSTEM_READY:
            Trace(1,"system initialize complete");
            break;

        case API_EVENT_ID_NETWORK_REGISTERED_HOME:
        case API_EVENT_ID_NETWORK_REGISTERED_ROAMING:
            Trace(1,"network register success");
            Network_StartAttach();
            break;

        case API_EVENT_ID_NETWORK_ATTACHED:
            Trace(1,"network attach success");
            Network_PDP_Context_t context = {
                .apn        ="internet.eplus.de",
                .userName   = "eplus"    ,
                .userPasswd = "gprs"
            };
            Network_StartActive(context);
            break;
        case API_EVENT_ID_GPS_UART_RECEIVED:
            Trace(1,"received GPS data,length:%d, data:%s,flag:%d",pEvent->param1,pEvent->pParam1,flag);
            GPS_Update(pEvent->pParam1,pEvent->param1);
            break;
        case API_EVENT_ID_UART_RECEIVED:
            if(pEvent->param1 == UART1)
            {
                uint8_t data[pEvent->param2+1];
                data[pEvent->param2] = 0;
                memcpy(data,pEvent->pParam1,pEvent->param2);
                Trace(1,"uart received data,length:%d,data:%s",pEvent->param2,data);
                if(strcmp(data,"close") == 0)
                {
                    Trace(1,"close gps");
                    GPS_Close();
                    isGpsOne = false;
                }
                else if(strcmp(data,"open") == 0)
                {
                    Trace(1,"open gps");
                    GPS_Open(NULL);
                    isGpsOne = true;
                }
            }
            break;

        case API_EVENT_ID_NETWORK_ACTIVATED:
            Trace(1,"network activate success..");
            OS_ReleaseSemaphore(semMqttStart);
            break;

        case API_EVENT_ID_SOCKET_CONNECTED:
            Trace(1,"socket connected");
            break;

        case API_EVENT_ID_SOCKET_CLOSED:
            Trace(1,"socket closed");

            break;

        default:
            break;
    }
}

void gps_testTask(void *pData)
{
    GPS_Info_t* gpsInfo = Gps_GetInfo();

    //wait for gprs register complete
    //The process of GPRS registration network may cause the power supply voltage of GPS to drop,
    //which resulting in GPS restart.
    while(!flag)
    {
        Trace(1,"wait for gprs regiter complete");
        OS_Sleep(2000);
    }

    //open GPS hardware(UART2 open either)
    GPS_Init();
    GPS_Open(NULL);

    //wait for gps start up, or gps will not response command
    while(gpsInfo->rmc.latitude.value == 0)
        OS_Sleep(1000);

    // set gps nmea output interval
    for(uint8_t i = 0;i<3;++i)
    {
        bool ret = GPS_SetOutputInterval(10000);
        Trace(1,"set gps ret:%d",ret);
        if(ret)
            break;
        OS_Sleep(1000);
    }

    // if(!GPS_ClearInfoInFlash())
    //     Trace(1,"erase gps fail");

    // if(!GPS_SetQzssOutput(false))
    //     Trace(1,"enable qzss nmea output fail");

    // if(!GPS_SetSearchMode(true,false,true,false))
    //     Trace(1,"set search mode fail");

    // if(!GPS_SetSBASEnable(true))
    //     Trace(1,"enable sbas fail");

    if(!GPS_GetVersion(buffer,150))
        Trace(1,"get gps firmware version fail");
    else
        Trace(1,"gps firmware version:%s",buffer);

    // if(!GPS_SetFixMode(GPS_FIX_MODE_LOW_SPEED))
        // Trace(1,"set fix mode fail");

    if(!GPS_SetOutputInterval(1000))
        Trace(1,"set nmea output interval fail");

    Trace(1,"init ok");

    while(1)
    {
        if(isGpsOne)
        {
            //show fix info
            uint8_t isFixed = gpsInfo->gsa[0].fix_type > gpsInfo->gsa[1].fix_type ?gpsInfo->gsa[0].fix_type:gpsInfo->gsa[1].fix_type;
            char* isFixedStr;
            if(isFixed == 2)
                isFixedStr = "2D fix";
            else if(isFixed == 3)
            {
                if(gpsInfo->gga.fix_quality == 1)
                    isFixedStr = "3D fix";
                else if(gpsInfo->gga.fix_quality == 2)
                    isFixedStr = "3D/DGPS fix";
            }
            else
                isFixedStr = "no fix";

            //convert unit ddmm.mmmm to degree(°)
            int temp = (int)(gpsInfo->rmc.latitude.value/gpsInfo->rmc.latitude.scale/100);
            double latitude = temp+(double)(gpsInfo->rmc.latitude.value - temp*gpsInfo->rmc.latitude.scale*100)/gpsInfo->rmc.latitude.scale/60.0;
            temp = (int)(gpsInfo->rmc.longitude.value/gpsInfo->rmc.longitude.scale/100);
            double longitude = temp+(double)(gpsInfo->rmc.longitude.value - temp*gpsInfo->rmc.longitude.scale*100)/gpsInfo->rmc.longitude.scale/60.0;

            //you can copy ` latitude,longitude ` to http://www.gpsspg.com/maps.htm check location on map

            snprintf(buffer,sizeof(buffer),"GPS fix mode:%d, BDS fix mode:%d, fix quality:%d, satellites tracked:%d, gps sates total:%d, is fixed:%s, coordinate:WGS84, Latitude:%f, Longitude:%f, unit:degree,altitude:%f",gpsInfo->gsa[0].fix_type, gpsInfo->gsa[1].fix_type,
                                                                gpsInfo->gga.fix_quality,gpsInfo->gga.satellites_tracked, gpsInfo->gsv[0].total_sats, isFixedStr, latitude,longitude,gpsInfo->gga.altitude);
            //show in tracer
            Trace(2,buffer);
            //send to UART1
            UART_Write(UART1,buffer,strlen(buffer));
            UART_Write(UART1,"\r\n\r\n",4);
        }

        OS_Sleep(5000);
    }
}

void gps_MainTask(void *pData)
{
    API_Event_t* event=NULL;

    //open UART1 to print NMEA infomation
    UART_Config_t config = {
        .baudRate = UART_BAUD_RATE_115200,
        .dataBits = UART_DATA_BITS_8,
        .stopBits = UART_STOP_BITS_1,
        .parity   = UART_PARITY_NONE,
        .rxCallback = NULL,
        .useEvent   = true
    };
    UART_Init(UART1,config);

    //Create UART1 send task and location print task
    OS_CreateTask(gps_testTask,
            NULL, NULL, GPS_TASK_STACK_SIZE, GPS_TASK_PRIORITY, 0, 0, GPS_TAST_NAME);

    //Wait event
    while(1)
    {
        if(OS_WaitEvent(gpsTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
        {
            EventDispatch(event);
            OS_Free(event->pParam1);
            OS_Free(event->pParam2);
            OS_Free(event);
        }
    }
}

void OnMqttReceived(void* arg, const char* topic, uint32_t payloadLen)
{
    Trace(1,"MQTT received publish data request, topic:%s, payload length:%d",topic,payloadLen);
}

void OnMqttReceiedData(void* arg, const uint8_t* data, uint16_t len, MQTT_Flags_t flags)
{
    Trace(1,"MQTT recieved publish data,  length:%d,data:%s",len,data);
    if(flags == MQTT_FLAG_DATA_LAST)
        Trace(1,"MQTT data is last frame");
}

 void OnMqttSubscribed(void* arg, MQTT_Error_t err)
 {
     if(err != MQTT_ERROR_NONE)
        Trace(1,"MQTT subscribe fail,error code:%d",err);
     else
        Trace(1,"MQTT subscribe success,topic:%s",(const char*)arg);
 }

void OnMqttConnection(MQTT_Client_t *client, void *arg, MQTT_Connection_Status_t status)
{
    Trace(1,"MQTT connection status:%d",status);
    MQTT_Event_t* event = (MQTT_Event_t*)OS_Malloc(sizeof(MQTT_Event_t));
    if(!event)
    {
        Trace(1,"MQTT no memory");
        return ;
    }
    if(status == MQTT_CONNECTION_ACCEPTED)
    {
        Trace(1,"MQTT succeed connect to broker");
        //!!! DO NOT suscribe here(interrupt function), do MQTT suscribe in task, or it will not excute
        event->id = MQTT_EVENT_CONNECTED;
        event->client = client;
        OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
    }
    else
    {
        event->id = MQTT_EVENT_DISCONNECTED;
        event->client = client;
        OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
        Trace(1,"MQTT connect to broker fail,error code:%d",status);
    }
    Trace(1,"MQTT OnMqttConnection() end");
}

void StartTimerPublish(uint32_t interval,MQTT_Client_t* client);
void OnPublish(void* arg, MQTT_Error_t err)
{
    if(err == MQTT_ERROR_NONE)
        Trace(1,"MQTT publish success");
    else
        Trace(1,"MQTT publish error, error code:%d",err);
}

void OnTimerPublish(void* param)
{
    MQTT_Error_t err;
    MQTT_Client_t* client = (MQTT_Client_t*)param;
    if(mqttStatus != MQTT_STATUS_CONNECTED)
    {
        Trace(1,"MQTT not connected to broker! can not publish");
        return;
    }
    publish_payload = buffer;
    snprintf(buffer->member, sizeof(buffer->member), "%s", publish_payload);
    Trace(1,"MQTT OnTimerPublish");
    err = MQTT_Publish(client,PUBLISH_TOPIC,publish_payload,strlen(publish_payload),1,2,0,OnPublish,NULL);
    if(err != MQTT_ERROR_NONE)
        Trace(1,"MQTT publish error, error code:%d",err);
    StartTimerPublish(PUBLISH_INTERVAL,client);
}

void StartTimerPublish(uint32_t interval,MQTT_Client_t* client)
{
    OS_StartCallbackTimer(mainTaskHandle,interval,OnTimerPublish,(void*)client);
}

void SecondTaskEventDispatch(MQTT_Event_t* pEvent)
{
    switch(pEvent->id)
    {
        case MQTT_EVENT_CONNECTED:
            mqttStatus = MQTT_STATUS_CONNECTED;
            Trace(1,"MQTT connected, now subscribe topic:%s",SUBSCRIBE_TOPIC);
            MQTT_Error_t err;
            MQTT_SetInPubCallback(pEvent->client, OnMqttReceived, OnMqttReceiedData, NULL);
            err = MQTT_Subscribe(pEvent->client,SUBSCRIBE_TOPIC,2,OnMqttSubscribed,(void*)SUBSCRIBE_TOPIC);
            if(err != MQTT_ERROR_NONE)
                Trace(1,"MQTT subscribe error, error code:%d",err);
            StartTimerPublish(PUBLISH_INTERVAL,pEvent->client);
            break;
        case MQTT_EVENT_DISCONNECTED:
            mqttStatus = MQTT_STATUS_DISCONNECTED;
            break;
        default:
            break;
    }
}

void SecondTask(void *pData)
{
    MQTT_Event_t* event=NULL;
    semMqttStart = OS_CreateSemaphore(0);
    OS_WaitForSemaphore(semMqttStart,OS_WAIT_FOREVER);
    OS_DeleteSemaphore(semMqttStart);
    Trace(1,"start mqtt test");
    MQTT_Client_t* client = MQTT_ClientNew();
    MQTT_Connect_Info_t ci;
    MQTT_Error_t err;
    memset(&ci,0,sizeof(MQTT_Connect_Info_t));
    ci.client_id = CLIENT_ID;
    ci.client_user = CLIENT_USER;
    ci.client_pass = CLIENT_PASS;
    ci.keep_alive = 60;
    ci.clean_session = 1;
    ci.use_ssl = false;

    err = MQTT_Connect(client,BROKER_IP,BROKER_PORT,OnMqttConnection,NULL,&ci);
    if(err != MQTT_ERROR_NONE)
        Trace(1,"MQTT connect fail,error code:%d",err);

    while(1)
    {
        if(OS_WaitEvent(secondTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
        {
            SecondTaskEventDispatch(event);
            OS_Free(event);
        }
    }
}

void MainTask(void *pData)
{
    API_Event_t* event=NULL;

    secondTaskHandle = OS_CreateTask(SecondTask,
        NULL, NULL, SECOND_TASK_STACK_SIZE, SECOND_TASK_PRIORITY, 0, 0, SECOND_TASK_NAME);

    while(1)
    {
        if(OS_WaitEvent(mainTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
        {
            EventDispatch(event);
            OS_Free(event->pParam1);
            OS_Free(event->pParam2);
            OS_Free(event);
        }
    }
}

void mqtt_Main(void)
{
    delay(5000);
    Trace(1,"mqtt_Main task started");
    delay(5000);
    mainTaskHandle = OS_CreateTask(MainTask,
        NULL, NULL, MQTT_TASK_STACK_SIZE, MQTT_TASK_PRIORITY, 0, 0, MQTT_TASK_NAME);
    OS_SetUserMainHandle(&mainTaskHandle);
    gpsTaskHandle = OS_CreateTask(gps_MainTask,
        NULL, NULL, GPS_TASK_STACK_SIZE, GPS_TASK_PRIORITY, 0, 0, GPS_TAST_NAME);
    OS_SetUserMainHandle(&gpsTaskHandle);
}

However the code is not working yet, the compiler gives an error
PS C:\GPRS_C_SDK> ./build.bat demo mqtt
CSDTK PATH: C:\GPRS_C_SDK\CSDTK42
build folder exist
number of processors: 4
Build host is WINDOWS

MAKE              init

MAKE              libs

MAKE              libs/gps

MAKE              libs/gps/minmea

PREPARING         libgps_debug.a

MAKE              libs/utils

PREPARING         liblibs_debug.a

MAKE              demo/mqtt
CC                demo_mqtt.c
src/demo_mqtt.c: In function 'gps_testTask':
src/demo_mqtt.c:232: warning: format '%f' expects type 'double', but argument 12 has type 'struct minmea_float'
src/demo_mqtt.c: In function 'OnTimerPublish':
src/demo_mqtt.c:342: error: incompatible types when assigning to type 'char[300]' from type 'char *'
src/demo_mqtt.c:343: error: request for member 'member' in something not a structure or union
src/demo_mqtt.c:343: error: request for member 'member' in something not a structure or union
src/demo_mqtt.c: In function 'mqtt_Main':
src/demo_mqtt.c:431: warning: implicit declaration of function 'delay'
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:958: recipe for target 'C:/GPRS_C_SDK/build/mqtt/demo/mqtt/obj/debug/de
mo_mqtt.o' failed
make[3]: *** [C:/GPRS_C_SDK/build/mqtt/demo/mqtt/obj/debug/demo_mqtt.o] Error 1
make[3]: *** Waiting for unfinished jobs....
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:975: recipe for target 'dependencies' failed
make[2]: *** [dependencies] Error 2
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:718: recipe for target 'C:/GPRS_C_SDK/build/mqtt//mqtt.srec' failed
make[1]: *** [C:/GPRS_C_SDK/build/mqtt//mqtt.srec] Error 2
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:371: recipe for target 'lod' failed
make: *** [lod] Error 2
ROM    total:1048576 Bytes     used:2656 Bytes
RAM    total:1048576 Bytes     used:32 Bytes
=== Build Time: 1s at 19.07.2018 17:30:22,72 ===
_____________________________________________________
PS C:\GPRS_C_SDK>

somehow it seems that there is a problem converting char* to char[].

Hello there,
Thanks...
But anyhow I want to make it work.
We can put our combined efforts to solve this!
If you don't mind. how can I reach you?
Do you have Skype ID or something?
Thanks for your response.
On Thu 19 Jul, 2018, 9:11 PM Nathan Scheufele, notifications@github.com
wrote:

I have tried the same, but had no succes.
here is my code:
#include "stdbool.h"
#include "stdint.h"
#include "stdio.h"
#include "string.h"
#include "api_os.h"
#include "api_debug.h"
#include "api_event.h"
#include "api_mqtt.h"
#include "api_network.h"
#include "api_socket.h"
#include <string.h>
#include <api_gps.h>
#include <api_event.h>
#include <api_hal_uart.h>
#include "gps_parse.h"
#include "math.h"
#include "gps.h"
#define BROKER_IP  "scheufele.ddns.net"
#define BROKER_PORT 1883
#define CLIENT_ID  "gprs"
#define CLIENT_USER ""
#define CLIENT_PASS ""
#define SUBSCRIBE_TOPIC "app"
#define PUBLISH_TOPIC   "gps"
#define PUBLISH_INTERVAL 5000
#define MQTT_TASK_STACK_SIZE    (2048 * 2)
#define MQTT_TASK_PRIORITY      2
#define MQTT_TASK_NAME          "Main Test Task"
#define SECOND_TASK_STACK_SIZE    (2048 * 2)
#define SECOND_TASK_PRIORITY      3
#define SECOND_TASK_NAME          "MQTT Test Task"
#define GPS_TASK_STACK_SIZE    (2048 * 2)
#define GPS_TASK_PRIORITY      1
#define GPS_TAST_NAME          "GPS Test Task"
static HANDLE gpsTaskHandle = NULL;
bool flag = false;
bool isGpsOne = true;
static HANDLE mainTaskHandle = NULL;
static HANDLE secondTaskHandle = NULL;
static HANDLE semMqttStart = NULL;
char publish_payload[300] = "Hier wird die GPS-Information stehen.";
char buffer[300];
typedef enum{
MQTT_EVENT_CONNECTED = 0,
MQTT_EVENT_DISCONNECTED ,
MQTT_EVENT_MAX
}MQTT_Event_ID_t;
typedef struct {
MQTT_Event_ID_t id;
MQTT_Client_t* client;
}MQTT_Event_t;
typedef enum{
MQTT_STATUS_DISCONNECTED = 0,
MQTT_STATUS_CONNECTED       ,
MQTT_STATUS_MAX
}MQTT_Status_t;
MQTT_Status_t mqttStatus = MQTT_STATUS_DISCONNECTED;
static void EventDispatch(API_Event_t* pEvent)
{
switch(pEvent->id)
{
case API_EVENT_ID_NO_SIMCARD:
Trace(1,"!!NO SIM CARD%d!!!!",pEvent->param1);
break;
    case API_EVENT_ID_SYSTEM_READY:
        Trace(1,"system initialize complete");
        break;

    case API_EVENT_ID_NETWORK_REGISTERED_HOME:
    case API_EVENT_ID_NETWORK_REGISTERED_ROAMING:
        Trace(1,"network register success");
        Network_StartAttach();
        break;

    case API_EVENT_ID_NETWORK_ATTACHED:
        Trace(1,"network attach success");
        Network_PDP_Context_t context = {
            .apn        ="internet.eplus.de",
            .userName   = "eplus"    ,
            .userPasswd = "gprs"
        };
        Network_StartActive(context);
        break;
    case API_EVENT_ID_GPS_UART_RECEIVED:
        Trace(1,"received GPS data,length:%d, data:%s,flag:%d",pEvent->param1,pEvent->pParam1,flag);
        GPS_Update(pEvent->pParam1,pEvent->param1);
        break;
    case API_EVENT_ID_UART_RECEIVED:
        if(pEvent->param1 == UART1)
        {
            uint8_t data[pEvent->param2+1];
            data[pEvent->param2] = 0;
            memcpy(data,pEvent->pParam1,pEvent->param2);
            Trace(1,"uart received data,length:%d,data:%s",pEvent->param2,data);
            if(strcmp(data,"close") == 0)
            {
                Trace(1,"close gps");
                GPS_Close();
                isGpsOne = false;
            }
            else if(strcmp(data,"open") == 0)
            {
                Trace(1,"open gps");
                GPS_Open(NULL);
                isGpsOne = true;
            }
        }
        break;

    case API_EVENT_ID_NETWORK_ACTIVATED:
        Trace(1,"network activate success..");
        OS_ReleaseSemaphore(semMqttStart);
        break;

    case API_EVENT_ID_SOCKET_CONNECTED:
        Trace(1,"socket connected");
        break;

    case API_EVENT_ID_SOCKET_CLOSED:
        Trace(1,"socket closed");

        break;

    default:
        break;
}

}
void gps_testTask(void pData)
{
GPS_Info_t gpsInfo = Gps_GetInfo();
//wait for gprs register complete
//The process of GPRS registration network may cause the power supply voltage of GPS to drop,
//which resulting in GPS restart.
while(!flag)
{
    Trace(1,"wait for gprs regiter complete");
    OS_Sleep(2000);
}

//open GPS hardware(UART2 open either)
GPS_Init();
GPS_Open(NULL);

//wait for gps start up, or gps will not response command
while(gpsInfo->rmc.latitude.value == 0)
    OS_Sleep(1000);

// set gps nmea output interval
for(uint8_t i = 0;i<3;++i)
{
    bool ret = GPS_SetOutputInterval(10000);
    Trace(1,"set gps ret:%d",ret);
    if(ret)
        break;
    OS_Sleep(1000);
}

// if(!GPS_ClearInfoInFlash())
//     Trace(1,"erase gps fail");

// if(!GPS_SetQzssOutput(false))
//     Trace(1,"enable qzss nmea output fail");

// if(!GPS_SetSearchMode(true,false,true,false))
//     Trace(1,"set search mode fail");

// if(!GPS_SetSBASEnable(true))
//     Trace(1,"enable sbas fail");

if(!GPS_GetVersion(buffer,150))
    Trace(1,"get gps firmware version fail");
else
    Trace(1,"gps firmware version:%s",buffer);

// if(!GPS_SetFixMode(GPS_FIX_MODE_LOW_SPEED))
    // Trace(1,"set fix mode fail");

if(!GPS_SetOutputInterval(1000))
    Trace(1,"set nmea output interval fail");

Trace(1,"init ok");

while(1)
{
    if(isGpsOne)
    {
        //show fix info
        uint8_t isFixed = gpsInfo->gsa[0].fix_type > gpsInfo->gsa[1].fix_type ?gpsInfo->gsa[0].fix_type:gpsInfo->gsa[1].fix_type;
        char* isFixedStr;
        if(isFixed == 2)
            isFixedStr = "2D fix";
        else if(isFixed == 3)
        {
            if(gpsInfo->gga.fix_quality == 1)
                isFixedStr = "3D fix";
            else if(gpsInfo->gga.fix_quality == 2)
                isFixedStr = "3D/DGPS fix";
        }
        else
            isFixedStr = "no fix";

        //convert unit ddmm.mmmm to degree(°)
        int temp = (int)(gpsInfo->rmc.latitude.value/gpsInfo->rmc.latitude.scale/100);
        double latitude = temp+(double)(gpsInfo->rmc.latitude.value - temp*gpsInfo->rmc.latitude.scale*100)/gpsInfo->rmc.latitude.scale/60.0;
        temp = (int)(gpsInfo->rmc.longitude.value/gpsInfo->rmc.longitude.scale/100);
        double longitude = temp+(double)(gpsInfo->rmc.longitude.value - temp*gpsInfo->rmc.longitude.scale*100)/gpsInfo->rmc.longitude.scale/60.0;

        //you can copy ` latitude,longitude ` to http://www.gpsspg.com/maps.htm check location on map

        snprintf(buffer,sizeof(buffer),"GPS fix mode:%d, BDS fix mode:%d, fix quality:%d, satellites tracked:%d, gps sates total:%d, is fixed:%s, coordinate:WGS84, Latitude:%f, Longitude:%f, unit:degree,altitude:%f",gpsInfo->gsa[0].fix_type, gpsInfo->gsa[1].fix_type,
                                                            gpsInfo->gga.fix_quality,gpsInfo->gga.satellites_tracked, gpsInfo->gsv[0].total_sats, isFixedStr, latitude,longitude,gpsInfo->gga.altitude);
        //show in tracer
        Trace(2,buffer);
        //send to UART1
        UART_Write(UART1,buffer,strlen(buffer));
        UART_Write(UART1,"\r\n\r\n",4);
    }

    OS_Sleep(5000);
}

}
void gps_MainTask(void pData)
{
API_Event_t event=NULL;
//open UART1 to print NMEA infomation
UART_Config_t config = {
    .baudRate = UART_BAUD_RATE_115200,
    .dataBits = UART_DATA_BITS_8,
    .stopBits = UART_STOP_BITS_1,
    .parity   = UART_PARITY_NONE,
    .rxCallback = NULL,
    .useEvent   = true
};
UART_Init(UART1,config);

//Create UART1 send task and location print task
OS_CreateTask(gps_testTask,
        NULL, NULL, GPS_TASK_STACK_SIZE, GPS_TASK_PRIORITY, 0, 0, GPS_TAST_NAME);

//Wait event
while(1)
{
    if(OS_WaitEvent(gpsTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
    {
        EventDispatch(event);
        OS_Free(event->pParam1);
        OS_Free(event->pParam2);
        OS_Free(event);
    }
}

}
void OnMqttReceived(void* arg, const char* topic, uint32_t payloadLen)
{
Trace(1,"MQTT received publish data request, topic:%s, payload length:%d",topic,payloadLen);
}
void OnMqttReceiedData(void* arg, const uint8_t* data, uint16_t len, MQTT_Flags_t flags)
{
Trace(1,"MQTT recieved publish data,  length:%d,data:%s",len,data);
if(flags == MQTT_FLAG_DATA_LAST)
Trace(1,"MQTT data is last frame");
}
void OnMqttSubscribed(void* arg, MQTT_Error_t err)
{
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT subscribe fail,error code:%d",err);
else
Trace(1,"MQTT subscribe success,topic:%s",(const char*)arg);
}
void OnMqttConnection(MQTT_Client_t client, void arg, MQTT_Connection_Status_t status)
{
Trace(1,"MQTT connection status:%d",status);
MQTT_Event_t event = (MQTT_Event_t)OS_Malloc(sizeof(MQTT_Event_t));
if(!event)
{
Trace(1,"MQTT no memory");
return ;
}
if(status == MQTT_CONNECTION_ACCEPTED)
{
Trace(1,"MQTT succeed connect to broker");
//!!! DO NOT suscribe here(interrupt function), do MQTT suscribe in task, or it will not excute
event->id = MQTT_EVENT_CONNECTED;
event->client = client;
OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
}
else
{
event->id = MQTT_EVENT_DISCONNECTED;
event->client = client;
OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
Trace(1,"MQTT connect to broker fail,error code:%d",status);
}
Trace(1,"MQTT OnMqttConnection() end");
}
void StartTimerPublish(uint32_t interval,MQTT_Client_t* client);
void OnPublish(void* arg, MQTT_Error_t err)
{
if(err == MQTT_ERROR_NONE)
Trace(1,"MQTT publish success");
else
Trace(1,"MQTT publish error, error code:%d",err);
}
void OnTimerPublish(void* param)
{
MQTT_Error_t err;
MQTT_Client_t* client = (MQTT_Client_t*)param;
if(mqttStatus != MQTT_STATUS_CONNECTED)
{
Trace(1,"MQTT not connected to broker! can not publish");
return;
}
publish_payload = buffer;
snprintf(buffer->member, sizeof(buffer->member), "%s", publish_payload);
Trace(1,"MQTT OnTimerPublish");
err = MQTT_Publish(client,PUBLISH_TOPIC,publish_payload,strlen(publish_payload),1,2,0,OnPublish,NULL);
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT publish error, error code:%d",err);
StartTimerPublish(PUBLISH_INTERVAL,client);
}
void StartTimerPublish(uint32_t interval,MQTT_Client_t* client)
{
OS_StartCallbackTimer(mainTaskHandle,interval,OnTimerPublish,(void*)client);
}
void SecondTaskEventDispatch(MQTT_Event_t* pEvent)
{
switch(pEvent->id)
{
case MQTT_EVENT_CONNECTED:
mqttStatus = MQTT_STATUS_CONNECTED;
Trace(1,"MQTT connected, now subscribe topic:%s",SUBSCRIBE_TOPIC);
MQTT_Error_t err;
MQTT_SetInPubCallback(pEvent->client, OnMqttReceived, OnMqttReceiedData, NULL);
err = MQTT_Subscribe(pEvent->client,SUBSCRIBE_TOPIC,2,OnMqttSubscribed,(void*)SUBSCRIBE_TOPIC);
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT subscribe error, error code:%d",err);
StartTimerPublish(PUBLISH_INTERVAL,pEvent->client);
break;
case MQTT_EVENT_DISCONNECTED:
mqttStatus = MQTT_STATUS_DISCONNECTED;
break;
default:
break;
}
}
void SecondTask(void pData)
{
MQTT_Event_t event=NULL;
semMqttStart = OS_CreateSemaphore(0);
OS_WaitForSemaphore(semMqttStart,OS_WAIT_FOREVER);
OS_DeleteSemaphore(semMqttStart);
Trace(1,"start mqtt test");
MQTT_Client_t* client = MQTT_ClientNew();
MQTT_Connect_Info_t ci;
MQTT_Error_t err;
memset(&ci,0,sizeof(MQTT_Connect_Info_t));
ci.client_id = CLIENT_ID;
ci.client_user = CLIENT_USER;
ci.client_pass = CLIENT_PASS;
ci.keep_alive = 60;
ci.clean_session = 1;
ci.use_ssl = false;
err = MQTT_Connect(client,BROKER_IP,BROKER_PORT,OnMqttConnection,NULL,&ci);
if(err != MQTT_ERROR_NONE)
    Trace(1,"MQTT connect fail,error code:%d",err);

while(1)
{
    if(OS_WaitEvent(secondTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
    {
        SecondTaskEventDispatch(event);
        OS_Free(event);
    }
}

}
void MainTask(void pData)
{
API_Event_t event=NULL;
secondTaskHandle = OS_CreateTask(SecondTask,
    NULL, NULL, SECOND_TASK_STACK_SIZE, SECOND_TASK_PRIORITY, 0, 0, SECOND_TASK_NAME);

while(1)
{
    if(OS_WaitEvent(mainTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
    {
        EventDispatch(event);
        OS_Free(event->pParam1);
        OS_Free(event->pParam2);
        OS_Free(event);
    }
}

}
void mqtt_Main(void)
{
delay(5000);
Trace(1,"mqtt_Main task started");
delay(5000);
mainTaskHandle = OS_CreateTask(MainTask,
NULL, NULL, MQTT_TASK_STACK_SIZE, MQTT_TASK_PRIORITY, 0, 0, MQTT_TASK_NAME);
OS_SetUserMainHandle(&mainTaskHandle);
gpsTaskHandle = OS_CreateTask(gps_MainTask,
NULL, NULL, GPS_TASK_STACK_SIZE, GPS_TASK_PRIORITY, 0, 0, GPS_TAST_NAME);
OS_SetUserMainHandle(&gpsTaskHandle);
}
However the code is not working yet, the compiler gives an error
PS C:\GPRS_C_SDK> ./build.bat demo mqtt
CSDTK PATH: C:\GPRS_C_SDK\CSDTK42
build folder exist
number of processors: 4
Build host is WINDOWS
MAKE              init
MAKE              libs
MAKE              libs/gps
MAKE              libs/gps/minmea
PREPARING         libgps_debug.a
MAKE              libs/utils
PREPARING         liblibs_debug.a
MAKE              demo/mqtt
CC                demo_mqtt.c
src/demo_mqtt.c: In function 'gps_testTask':
src/demo_mqtt.c:232: warning: format '%f' expects type 'double', but argument 12 has type 'struct minmea_float'
src/demo_mqtt.c: In function 'OnTimerPublish':
src/demo_mqtt.c:342: error: incompatible types when assigning to type 'char[300]' from type 'char *'
src/demo_mqtt.c:343: error: request for member 'member' in something not a structure or union
src/demo_mqtt.c:343: error: request for member 'member' in something not a structure or union
src/demo_mqtt.c: In function 'mqtt_Main':
src/demo_mqtt.c:431: warning: implicit declaration of function 'delay'
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:958: recipe for target 'C:/GPRS_C_SDK/build/mqtt/demo/mqtt/obj/debug/de
mo_mqtt.o' failed
make[3]: *** [C:/GPRS_C_SDK/build/mqtt/demo/mqtt/obj/debug/demo_mqtt.o] Error 1
make[3]: *** Waiting for unfinished jobs....
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:975: recipe for target 'dependencies' failed
make[2]: *** [dependencies] Error 2
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:718: recipe for target 'C:/GPRS_C_SDK/build/mqtt//mqtt.srec' failed
make[1]: *** [C:/GPRS_C_SDK/build/mqtt//mqtt.srec] Error 2
C:/GPRS_C_SDK/platform/compilation/cust_rules.mk:371: recipe for target 'lod' failed
make: *** [lod] Error 2
ROM    total:1048576 Bytes     used:2656 Bytes
RAM    total:1048576 Bytes     used:32 Bytes
=== Build Time: 1s at 19.07.2018 17:30:22,72 ===

PS C:\GPRS_C_SDK>
somehow it seems that there is a problem converting char* to char[].
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Ai-Thinker-Open/GPRS_C_SDK/issues/165#issuecomment-406321925,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AkiMqiuiQWy4rz_MabyekMQa5NjQfvAVks5uIKiqgaJpZM4VQ67l
.

Hello,@neutree I already did this I'm able to send data to mosquitito server as well as to secure microsoft AZURE  platform...
Please don't close any issues if you can't help..!
😏🙄

please close you ticket if you  resolved your problem as you describe, and you not you can reopen it

This code is working, It sends gps data to demo.thingsboard.com.
`#include "string.h"
#include "stdio.h"
#include "api_os.h"
#include "api_gps.h"
#include "api_event.h"
#include "api_hal_uart.h"
#include "api_debug.h"
#include "buffer.h"
#include "gps_parse.h"
#include "math.h"
#include "gps.h"
#include "stdbool.h"
#include "stdint.h"
#include "api_mqtt.h"
#include "api_network.h"
#include "api_socket.h"
#define MAIN_TASK_STACK_SIZE    (1024 * 2)
#define MAIN_TASK_PRIORITY      0
#define MAIN_TASK_NAME          "Main Task"
#define SECOND_TASK_STACK_SIZE    (1024 * 2)
#define SECOND_TASK_PRIORITY      1
#define SECOND_TASK_NAME          "Second Task"
#define BROKER_IP  "demo.thingsboard.io"
#define BROKER_PORT 1883
#define CLIENT_ID  "A9G GPRS"
#define CLIENT_USER "rieIPosjsTkdn6GbLFYs"
#define CLIENT_PASS "mqtt"
#define SUBSCRIBE_TOPIC "v1/devices/me/rpc/request/+"
#define PUBLISH_TOPIC   "v1/devices/me/telemetry"
#define PUBLISH_INTERVAL 5000 //10s
#define PUBLISH_PAYLOEAD "{"temperature":"50","humidity":"60"}"
HANDLE mainTaskHandle  = NULL;
HANDLE secondTaskHandle = NULL;
//Variáveis MQTT
static HANDLE semMqttStart = NULL;
typedef enum{
MQTT_EVENT_CONNECTED = 0,
MQTT_EVENT_DISCONNECTED ,
MQTT_EVENT_MAX
}MQTT_Event_ID_t;
typedef struct {
MQTT_Event_ID_t id;
MQTT_Client_t* client;
}MQTT_Event_t;
typedef enum{
MQTT_STATUS_DISCONNECTED = 0,
MQTT_STATUS_CONNECTED       ,
MQTT_STATUS_MAX
}MQTT_Status_t;
MQTT_Status_t mqttStatus = MQTT_STATUS_DISCONNECTED;
// Variáveis GPS
bool flag = false;
bool isGpsOn = true;
void OnMqttReceived(void* arg, const char* topic, uint32_t payloadLen)
{
Trace(1,"MQTT received publish data request, topic:%s, payload length:%d",topic,payloadLen);
}
void OnMqttReceiedData(void* arg, const uint8_t* data, uint16_t len, MQTT_Flags_t flags)
{
Trace(1,"MQTT recieved publish data,  length:%d,data:%s",len,data);
if(flags == MQTT_FLAG_DATA_LAST)
Trace(1,"MQTT data is last frame");
}
void OnMqttSubscribed(void* arg, MQTT_Error_t err)
{
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT subscribe fail,error code:%d",err);
else
Trace(1,"MQTT subscribe success,topic:%s",(const char*)arg);
}
void OnMqttConnection(MQTT_Client_t client, void arg, MQTT_Connection_Status_t status)
{
Trace(1,"MQTT connection status:%d",status);
MQTT_Event_t event = (MQTT_Event_t)OS_Malloc(sizeof(MQTT_Event_t));
if(!event)
{
Trace(1,"MQTT no memory");
return ;
}
if(status == MQTT_CONNECTION_ACCEPTED)
{
Trace(1,"MQTT succeed connect to broker");
//!!! DO NOT suscribe here(interrupt function), do MQTT suscribe in task, or it will not excute
event->id = MQTT_EVENT_CONNECTED;
event->client = client;
OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
}
else
{
event->id = MQTT_EVENT_DISCONNECTED;
event->client = client;
OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
Trace(1,"MQTT connect to broker fail,error code:%d",status);
}
Trace(1,"MQTT OnMqttConnection() end");
}
void StartTimerPublish(uint32_t interval,MQTT_Client_t* client);
void OnPublish(void* arg, MQTT_Error_t err)
{
if(err == MQTT_ERROR_NONE)
Trace(1,"MQTT publish success");
else
Trace(1,"MQTT publish error, error code:%d",err);
}
void OnTimerPublish(void* param)
{
MQTT_Error_t err;
MQTT_Client_t* client = (MQTT_Client_t*)param;
if(mqttStatus != MQTT_STATUS_CONNECTED)
{
Trace(1,"MQTT not connected to broker! can not publish");
return;
}
GPS_Info_t* gpsInfo = Gps_GetInfo();
uint8_t buffer[300];
//show fix info
uint8_t isFixed = gpsInfo->gsa[0].fix_type > gpsInfo->gsa[1].fix_type ?gpsInfo->gsa[0].fix_type:gpsInfo->gsa[1].fix_type;
char* isFixedStr;
if(isFixed == 2)
	isFixedStr = "2D fix";
else if(isFixed == 3)
{
	if(gpsInfo->gga.fix_quality == 1)
		isFixedStr = "3D fix";
	else if(gpsInfo->gga.fix_quality == 2)
		isFixedStr = "3D/DGPS fix";
}
else
	isFixedStr = "no fix";

//convert unit ddmm.mmmm to degree(°)
int temp = (int)(gpsInfo->rmc.latitude.value/gpsInfo->rmc.latitude.scale/100);
double latitude = temp+(double)(gpsInfo->rmc.latitude.value - temp*gpsInfo->rmc.latitude.scale*100)/gpsInfo->rmc.latitude.scale/60.0;
temp = (int)(gpsInfo->rmc.longitude.value/gpsInfo->rmc.longitude.scale/100);
double longitude = temp+(double)(gpsInfo->rmc.longitude.value - temp*gpsInfo->rmc.longitude.scale*100)/gpsInfo->rmc.longitude.scale/60.0;

//you can copy ` latitude,longitude ` to http://www.gpsspg.com/maps.htm check location on map

//snprintf(buffer,sizeof(buffer),"GPS fix mode:%d, BDS fix mode:%d, fix quality:%d, satellites tracked:%d, gps sates total:%d, is fixed:%s, coordinate:WGS84, Latitude:%f, Longitude:%f, unit:degree,altitude:%f",gpsInfo->gsa[0].fix_type, gpsInfo->gsa[1].fix_type,
//													gpsInfo->gga.fix_quality,gpsInfo->gga.satellites_tracked, gpsInfo->gsv[0].total_sats, isFixedStr, latitude,longitude,gpsInfo->gga.altitude);
//show in tracer
//Trace(2,buffer);
snprintf(buffer,sizeof(buffer),"{\"latitude\":\"%f\",\"longitude\":\"%f\"}",latitude,longitude);
Trace(2,buffer);
Trace(1,"MQTT OnTimerPublish");
err = MQTT_Publish(client,PUBLISH_TOPIC,buffer,strlen(buffer),1,2,0,OnPublish,NULL);
if(err != MQTT_ERROR_NONE)
    Trace(1,"MQTT publish error, error code:%d",err);
StartTimerPublish(PUBLISH_INTERVAL,client);

}
void StartTimerPublish(uint32_t interval,MQTT_Client_t* client)
{
OS_StartCallbackTimer(mainTaskHandle,interval,OnTimerPublish,(void*)client);
}
void SecondTaskEventDispatch(MQTT_Event_t* pEvent)
{
switch(pEvent->id)
{
case MQTT_EVENT_CONNECTED:
mqttStatus = MQTT_STATUS_CONNECTED;
Trace(1,"MQTT connected, now subscribe topic:%s",SUBSCRIBE_TOPIC);
MQTT_Error_t err;
MQTT_SetInPubCallback(pEvent->client, OnMqttReceived, OnMqttReceiedData, NULL);
err = MQTT_Subscribe(pEvent->client,SUBSCRIBE_TOPIC,2,OnMqttSubscribed,(void*)SUBSCRIBE_TOPIC);
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT subscribe error, error code:%d",err);
StartTimerPublish(PUBLISH_INTERVAL,pEvent->client);
break;
case MQTT_EVENT_DISCONNECTED:
mqttStatus = MQTT_STATUS_DISCONNECTED;
break;
default:
break;
}
}
void EventDispatch(API_Event_t* pEvent)
{
switch(pEvent->id)
{
case API_EVENT_ID_NETWORK_REGISTERED_HOME:
case API_EVENT_ID_NETWORK_REGISTERED_ROAMING:
Trace(1,"Network register complete");
Network_StartAttach();
flag = true;
break;
    case API_EVENT_ID_GPS_UART_RECEIVED:
        Trace(1,"received GPS data,length:%d, data:%s,flag:%d",pEvent->param1,pEvent->pParam1,flag);
        GPS_Update(pEvent->pParam1,pEvent->param1);
        break;
    case API_EVENT_ID_UART_RECEIVED:
        if(pEvent->param1 == UART1)
        {
            uint8_t data[pEvent->param2+1];
            data[pEvent->param2] = 0;
            memcpy(data,pEvent->pParam1,pEvent->param2);
            Trace(1,"uart received data,length:%d,data:%s",pEvent->param2,data);
            if(strcmp(data,"close") == 0)
            {
                Trace(1,"close gps");
                GPS_Close();
                isGpsOn = false;
            }
            else if(strcmp(data,"open") == 0)
            {
                Trace(1,"open gps");
                GPS_Open(NULL);
                isGpsOn = true;
            }
        }
        break;

    case API_EVENT_ID_NO_SIMCARD:
        Trace(1,"!!NO SIM CARD%d!!!!",pEvent->param1);
        break;

    case API_EVENT_ID_SYSTEM_READY:
        Trace(1,"system initialize complete");
        break;

    case API_EVENT_ID_NETWORK_ATTACHED:
        Trace(1,"network attach success");
        Network_PDP_Context_t context = {
            .apn        ="cmnet",
            .userName   = ""    ,
            .userPasswd = ""
        };
        Network_StartActive(context);
        break;

    case API_EVENT_ID_NETWORK_ACTIVATED:
        Trace(1,"network activate success..");
        OS_ReleaseSemaphore(semMqttStart);
        break;

    case API_EVENT_ID_SOCKET_CONNECTED:
        Trace(1,"socket connected");
        break;

    case API_EVENT_ID_SOCKET_CLOSED:
        Trace(1,"socket closed");

        break;

    case API_EVENT_ID_SIGNAL_QUALITY:
        Trace(1,"CSQ:%d",pEvent->param1);
        break;
    default:
        break;
}

}
void LoopTask(VOID pData)
{
GPS_Info_t gpsInfo = Gps_GetInfo();
uint8_t buffer[300];
//wait for gprs register complete
//The process of GPRS registration network may cause the power supply voltage of GPS to drop,
//which resulting in GPS restart.
while(!flag)
{
    Trace(1,"wait for gprs regiter complete");
    OS_Sleep(2000);
}

//open GPS hardware(UART2 open either)
GPS_Init();
GPS_Open(NULL);

//wait for gps start up, or gps will not response command
while(gpsInfo->rmc.latitude.value == 0)
    OS_Sleep(1000);

// set gps nmea output interval
for(uint8_t i = 0;i<5;++i)
{
    bool ret = GPS_SetOutputInterval(10000);
    Trace(1,"set gps ret:%d",ret);
    if(ret)
        break;
    OS_Sleep(1000);
}

// if(!GPS_ClearInfoInFlash())
//     Trace(1,"erase gps fail");

// if(!GPS_SetQzssOutput(false))
//     Trace(1,"enable qzss nmea output fail");

// if(!GPS_SetSearchMode(true,false,true,false))
//     Trace(1,"set search mode fail");

// if(!GPS_SetSBASEnable(true))
//     Trace(1,"enable sbas fail");

if(!GPS_GetVersion(buffer,150))
    Trace(1,"get gps firmware version fail");
else
    Trace(1,"gps firmware version:%s",buffer);

// if(!GPS_SetFixMode(GPS_FIX_MODE_LOW_SPEED))
    // Trace(1,"set fix mode fail");

if(!GPS_SetOutputInterval(1000))
    Trace(1,"set nmea output interval fail");

Trace(1,"init ok");

MQTT_Event_t* event=NULL;
semMqttStart = OS_CreateSemaphore(0);
//OS_WaitForSemaphore(semMqttStart,OS_WAIT_FOREVER);
OS_DeleteSemaphore(semMqttStart);
Trace(1,"start mqtt test");
MQTT_Client_t* client = MQTT_ClientNew();
MQTT_Connect_Info_t ci;
MQTT_Error_t err;
memset(&ci,0,sizeof(MQTT_Connect_Info_t));
ci.client_id = CLIENT_ID;
ci.client_user = CLIENT_USER;
ci.client_pass = CLIENT_PASS;
ci.keep_alive = 60;
ci.clean_session = 1;
ci.use_ssl = false;

err = MQTT_Connect(client,BROKER_IP,BROKER_PORT,OnMqttConnection,NULL,&ci);
if(err != MQTT_ERROR_NONE)
    Trace(1,"MQTT connect fail,error code:%d",err);

while(1)
{
    if(isGpsOn)
    {
        //show fix info
        uint8_t isFixed = gpsInfo->gsa[0].fix_type > gpsInfo->gsa[1].fix_type ?gpsInfo->gsa[0].fix_type:gpsInfo->gsa[1].fix_type;
        char* isFixedStr;
        if(isFixed == 2)
            isFixedStr = "2D fix";
        else if(isFixed == 3)
        {
            if(gpsInfo->gga.fix_quality == 1)
                isFixedStr = "3D fix";
            else if(gpsInfo->gga.fix_quality == 2)
                isFixedStr = "3D/DGPS fix";
        }
        else
            isFixedStr = "no fix";

        //convert unit ddmm.mmmm to degree(°)
        int temp = (int)(gpsInfo->rmc.latitude.value/gpsInfo->rmc.latitude.scale/100);
        double latitude = temp+(double)(gpsInfo->rmc.latitude.value - temp*gpsInfo->rmc.latitude.scale*100)/gpsInfo->rmc.latitude.scale/60.0;
        temp = (int)(gpsInfo->rmc.longitude.value/gpsInfo->rmc.longitude.scale/100);
        double longitude = temp+(double)(gpsInfo->rmc.longitude.value - temp*gpsInfo->rmc.longitude.scale*100)/gpsInfo->rmc.longitude.scale/60.0;

        //you can copy ` latitude,longitude ` to http://www.gpsspg.com/maps.htm check location on map

        snprintf(buffer,sizeof(buffer),"GPS fix mode:%d, BDS fix mode:%d, fix quality:%d, satellites tracked:%d, gps sates total:%d, is fixed:%s, coordinate:WGS84, Latitude:%f, Longitude:%f, unit:degree,altitude:%f",gpsInfo->gsa[0].fix_type, gpsInfo->gsa[1].fix_type,
                                                            gpsInfo->gga.fix_quality,gpsInfo->gga.satellites_tracked, gpsInfo->gsv[0].total_sats, isFixedStr, latitude,longitude,gpsInfo->gga.altitude);
        //show in tracer
        Trace(2,buffer);
    }

	if(OS_WaitEvent(secondTaskHandle, (void**)&event, OS_WAIT_FOREVER))
    {
        SecondTaskEventDispatch(event);
        OS_Free(event);
    }

    OS_Sleep(5000);
}

}
void AppMainTask(VOID pData)
{
API_Event_t event=NULL;
secondTaskHandle = OS_CreateTask(LoopTask ,
    NULL, NULL, SECOND_TASK_STACK_SIZE, SECOND_TASK_PRIORITY, 0, 0, SECOND_TASK_NAME);

while(1)
{
    if(OS_WaitEvent(mainTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
    {
        EventDispatch(event);
        OS_Free(event->pParam1);
        OS_Free(event->pParam2);
        OS_Free(event);
    }
}

}
void app_Main(void)
{
mainTaskHandle = OS_CreateTask(AppMainTask ,
NULL, NULL, MAIN_TASK_STACK_SIZE, MAIN_TASK_PRIORITY, 0, 0, MAIN_TASK_NAME);
OS_SetUserMainHandle(&mainTaskHandle);
}`

does it works? I just meet the same problem, but I have no idea about it. I want to see some guides or tuturil about it. Can you help me ? or send you the message by Jabber? whats app?

I have a question. when I run this code, it reports me the error: I don't understand these errors.
D:/GPRS_C_SDK_V2112/GPRS_C_SDK/build/testDai/init/lib\libinit_debug.a(sdk_init.o): In function user_Main': D:\GPRS_C_SDK_V2112\GPRS_C_SDK\init/src/sdk_init.c:30: undefined reference to testDai_Main'
value:0, p:ffffffff88240018, addend:0, symbol:0
D:\GPRS_C_SDK_V2112\GPRS_C_SDK\init/src/sdk_init.c:30: relocation truncated to fit: R_MIPS16_26 against `testDai_Main'
D:/GPRS_C_SDK_V2112/GPRS_C_SDK/platform/compilation/cust_rules.mk:722: recipe for target 'D:/GPRS_C_SDK_V2112/GPRS_C_SDK/build/testDai//testDai.elf' failed
make[2]: *** [D:/nuvelos/GPRS_C_SDK_V2112/GPRS_C_SDK/build/testDai//testDai.elf] Error 1
D:/GPRS_C_SDK_V2112/GPRS_C_SDK/platform/compilation/cust_rules.mk:718: recipe for target 'D:/GPRS_C_SDK_V2112/GPRS_C_SDK/build/testDai//testDai.srec' failed
make[1]: *** [D:/GPRS_C_SDK_V2112/GPRS_C_SDK/build/testDai//testDai.srec] Error 2
D:/GPRS_C_SDK_V2112/GPRS_C_SDK/platform/compilation/cust_rules.mk:371: recipe for target 'lod' failed
make: *** [lod] Error 2

void StartTimerPublish (intervalo uint32_t, cliente MQTT_Client_t *)
{
OS_StartCallbackTimer (mainTaskHandle, intervalo, OnTimerPublish, (void *) cliente);
}
void SecondTaskEventDispatch (MQTT_Event_t * pEvent)
{

no compila el codigo....

This one will be compiled:-)
`#include "string.h"
#include "stdio.h"
#include "api_os.h"
#include "api_gps.h"
#include "api_event.h"
#include "api_hal_uart.h"
#include "api_debug.h"
#include "buffer.h"
#include "gps_parse.h"
#include "math.h"
#include "gps.h"
#include "stdbool.h"
#include "stdint.h"
#include "api_mqtt.h"
#include "api_network.h"
#include "api_socket.h"
#define MAIN_TASK_STACK_SIZE (1024 * 2)
#define MAIN_TASK_PRIORITY 0
#define MAIN_TASK_NAME "Main Task"
#define SECOND_TASK_STACK_SIZE (1024 * 2)
#define SECOND_TASK_PRIORITY 1
#define SECOND_TASK_NAME "Second Task"
#define BROKER_IP "demo.thingsboard.io"
#define BROKER_PORT 1883
#define CLIENT_ID "A9G GPRS"
#define CLIENT_USER "rieIPosjsTkdn6GbLFYs"
#define CLIENT_PASS "mqtt"
#define SUBSCRIBE_TOPIC "v1/devices/me/rpc/request/+"
#define PUBLISH_TOPIC "v1/devices/me/telemetry"
#define PUBLISH_INTERVAL 5000 //10s
#define PUBLISH_PAYLOEAD "{"temperature":"50","humidity":"60"}"
HANDLE mainTaskHandle = NULL;
HANDLE secondTaskHandle = NULL;
//Variáveis MQTT
static HANDLE semMqttStart = NULL;
typedef enum{
MQTT_EVENT_CONNECTED = 0,
MQTT_EVENT_DISCONNECTED ,
MQTT_EVENT_MAX
}MQTT_Event_ID_t;
typedef struct {
MQTT_Event_ID_t id;
MQTT_Client_t* client;
}MQTT_Event_t;
typedef enum{
MQTT_STATUS_DISCONNECTED = 0,
MQTT_STATUS_CONNECTED ,
MQTT_STATUS_MAX
}MQTT_Status_t;
MQTT_Status_t mqttStatus = MQTT_STATUS_DISCONNECTED;
// Variáveis GPS
bool flag = false;
bool isGpsOn = true;
void OnMqttReceived(void* arg, const char* topic, uint32_t payloadLen)
{
Trace(1,"MQTT received publish data request, topic:%s, payload length:%d",topic,payloadLen);
}
void OnMqttReceiedData(void* arg, const uint8_t* data, uint16_t len, MQTT_Flags_t flags)
{
Trace(1,"MQTT recieved publish data, length:%d,data:%s",len,data);
if(flags == MQTT_FLAG_DATA_LAST)
Trace(1,"MQTT data is last frame");
}
void OnMqttSubscribed(void* arg, MQTT_Error_t err)
{
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT subscribe fail,error code:%d",err);
else
Trace(1,"MQTT subscribe success,topic:%s",(const char*)arg);
}
void OnMqttConnection(MQTT_Client_t client, void arg, MQTT_Connection_Status_t status)
{
Trace(1,"MQTT connection status:%d",status);
MQTT_Event_t* event = (MQTT_Event_t*)OS_Malloc(sizeof(MQTT_Event_t));
if(!event)
{
Trace(1,"MQTT no memory");
return ;
}
if(status == MQTT_CONNECTION_ACCEPTED)
{
Trace(1,"MQTT succeed connect to broker");
//!!! DO NOT suscribe here(interrupt function), do MQTT suscribe in task, or it will not excute
event->id = MQTT_EVENT_CONNECTED;
event->client = client;
OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
}
else
{
event->id = MQTT_EVENT_DISCONNECTED;
event->client = client;
OS_SendEvent(secondTaskHandle,event,OS_TIME_OUT_WAIT_FOREVER,OS_EVENT_PRI_NORMAL);
Trace(1,"MQTT connect to broker fail,error code:%d",status);
}
Trace(1,"MQTT OnMqttConnection() end");
}
void StartTimerPublish(uint32_t interval,MQTT_Client_t* client);
void OnPublish(void* arg, MQTT_Error_t err)
{
if(err == MQTT_ERROR_NONE)
Trace(1,"MQTT publish success");
else
Trace(1,"MQTT publish error, error code:%d",err);
}
void OnTimerPublish(void* param)
{
MQTT_Error_t err;
MQTT_Client_t* client = (MQTT_Client_t*)param;
if(mqttStatus != MQTT_STATUS_CONNECTED)
{
Trace(1,"MQTT not connected to broker! can not publish");
return;
}
GPS_Info_t* gpsInfo = Gps_GetInfo();
uint8_t buffer[300];
//show fix info
uint8_t isFixed = gpsInfo->gsa[0].fix_type > gpsInfo->gsa[1].fix_type ?gpsInfo->gsa[0].fix_type:gpsInfo->gsa[1].fix_type;
char* isFixedStr;
if(isFixed == 2)
isFixedStr = "2D fix";
else if(isFixed == 3)
{
if(gpsInfo->gga.fix_quality == 1)
isFixedStr = "3D fix";
else if(gpsInfo->gga.fix_quality == 2)
isFixedStr = "3D/DGPS fix";
}
else
isFixedStr = "no fix";
//convert unit ddmm.mmmm to degree(°)
int temp = (int)(gpsInfo->rmc.latitude.value/gpsInfo->rmc.latitude.scale/100);
double latitude = temp+(double)(gpsInfo->rmc.latitude.value - tempgpsInfo->rmc.latitude.scale100)/gpsInfo->rmc.latitude.scale/60.0;
temp = (int)(gpsInfo->rmc.longitude.value/gpsInfo->rmc.longitude.scale/100);
double longitude = temp+(double)(gpsInfo->rmc.longitude.value - tempgpsInfo->rmc.longitude.scale100)/gpsInfo->rmc.longitude.scale/60.0;
//you can copy latitude,longitude to http://www.gpsspg.com/maps.htm check location on map
//snprintf(buffer,sizeof(buffer),"GPS fix mode:%d, BDS fix mode:%d, fix quality:%d, satellites tracked:%d, gps sates total:%d, is fixed:%s, coordinate:WGS84, Latitude:%f, Longitude:%f, unit:degree,altitude:%f",gpsInfo->gsa[0].fix_type, gpsInfo->gsa[1].fix_type,
//													gpsInfo->gga.fix_quality,gpsInfo->gga.satellites_tracked, gpsInfo->gsv[0].total_sats, isFixedStr, latitude,longitude,gpsInfo->gga.altitude);
//show in tracer
//Trace(2,buffer);
snprintf(buffer,sizeof(buffer),"{"latitude":"%f","longitude":"%f"}",latitude,longitude);
Trace(2,buffer);
Trace(1,"MQTT OnTimerPublish");
err = MQTT_Publish(client,PUBLISH_TOPIC,buffer,strlen(buffer),1,2,0,OnPublish,NULL);
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT publish error, error code:%d",err);
StartTimerPublish(PUBLISH_INTERVAL,client);
}
void StartTimerPublish(uint32_t interval,MQTT_Client_t* client)
{
OS_StartCallbackTimer(mainTaskHandle,interval,OnTimerPublish,(void*)client);
}
void SecondTaskEventDispatch(MQTT_Event_t* pEvent)
{
switch(pEvent->id)
{
case MQTT_EVENT_CONNECTED:
mqttStatus = MQTT_STATUS_CONNECTED;
Trace(1,"MQTT connected, now subscribe topic:%s",SUBSCRIBE_TOPIC);
MQTT_Error_t err;
MQTT_SetInPubCallback(pEvent->client, OnMqttReceived, OnMqttReceiedData, NULL);
err = MQTT_Subscribe(pEvent->client,SUBSCRIBE_TOPIC,2,OnMqttSubscribed,(void*)SUBSCRIBE_TOPIC);
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT subscribe error, error code:%d",err);
StartTimerPublish(PUBLISH_INTERVAL,pEvent->client);
break;
case MQTT_EVENT_DISCONNECTED:
mqttStatus = MQTT_STATUS_DISCONNECTED;
break;
default:
break;
}
}
void EventDispatch(API_Event_t* pEvent)
{
switch(pEvent->id)
{
case API_EVENT_ID_NETWORK_REGISTERED_HOME:
case API_EVENT_ID_NETWORK_REGISTERED_ROAMING:
Trace(1,"Network register complete");
Network_StartAttach();
flag = true;
break;
case API_EVENT_ID_GPS_UART_RECEIVED:
    Trace(1,"received GPS data,length:%d, data:%s,flag:%d",pEvent->param1,pEvent->pParam1,flag);
    GPS_Update(pEvent->pParam1,pEvent->param1);
    break;
case API_EVENT_ID_UART_RECEIVED:
    if(pEvent->param1 == UART1)
    {
        uint8_t data[pEvent->param2+1];
        data[pEvent->param2] = 0;
        memcpy(data,pEvent->pParam1,pEvent->param2);
        Trace(1,"uart received data,length:%d,data:%s",pEvent->param2,data);
        if(strcmp(data,"close") == 0)
        {
            Trace(1,"close gps");
            GPS_Close();
            isGpsOn = false;
        }
        else if(strcmp(data,"open") == 0)
        {
            Trace(1,"open gps");
            GPS_Open(NULL);
            isGpsOn = true;
        }
    }
    break;

case API_EVENT_ID_NO_SIMCARD:
    Trace(1,"!!NO SIM CARD%d!!!!",pEvent->param1);
    break;

case API_EVENT_ID_SYSTEM_READY:
    Trace(1,"system initialize complete");
    break;

case API_EVENT_ID_NETWORK_ATTACHED:
    Trace(1,"network attach success");
    Network_PDP_Context_t context = {
        .apn        ="cmnet",
        .userName   = ""    ,
        .userPasswd = ""
    };
    Network_StartActive(context);
    break;

case API_EVENT_ID_NETWORK_ACTIVATED:
    Trace(1,"network activate success..");
    OS_ReleaseSemaphore(semMqttStart);
    break;

case API_EVENT_ID_SOCKET_CONNECTED:
    Trace(1,"socket connected");
    break;

case API_EVENT_ID_SOCKET_CLOSED:
    Trace(1,"socket closed");

    break;

case API_EVENT_ID_SIGNAL_QUALITY:
    Trace(1,"CSQ:%d",pEvent->param1);
    break;
default:
    break;

}
}
void LoopTask(void pData)
{
GPS_Info_t gpsInfo = Gps_GetInfo();
uint8_t buffer[300];
//wait for gprs register complete
//The process of GPRS registration network may cause the power supply voltage of GPS to drop,
//which resulting in GPS restart.
while(!flag)
{
Trace(1,"wait for gprs regiter complete");
OS_Sleep(2000);
}
//open GPS hardware(UART2 open either)
GPS_Init();
GPS_Open(NULL);
//wait for gps start up, or gps will not response command
while(gpsInfo->rmc.latitude.value == 0)
OS_Sleep(1000);
// set gps nmea output interval
for(uint8_t i = 0;i<5;++i)
{
bool ret = GPS_SetOutputInterval(10000);
Trace(1,"set gps ret:%d",ret);
if(ret)
break;
OS_Sleep(1000);
}
// if(!GPS_ClearInfoInFlash())
//     Trace(1,"erase gps fail");
// if(!GPS_SetQzssOutput(false))
//     Trace(1,"enable qzss nmea output fail");
// if(!GPS_SetSearchMode(true,false,true,false))
//     Trace(1,"set search mode fail");
// if(!GPS_SetSBASEnable(true))
//     Trace(1,"enable sbas fail");
if(!GPS_GetVersion(buffer,150))
Trace(1,"get gps firmware version fail");
else
Trace(1,"gps firmware version:%s",buffer);
// if(!GPS_SetFixMode(GPS_FIX_MODE_LOW_SPEED))
// Trace(1,"set fix mode fail");
if(!GPS_SetOutputInterval(1000))
Trace(1,"set nmea output interval fail");
Trace(1,"init ok");
MQTT_Event_t* event=NULL;
semMqttStart = OS_CreateSemaphore(0);
//OS_WaitForSemaphore(semMqttStart,OS_WAIT_FOREVER);
OS_DeleteSemaphore(semMqttStart);
Trace(1,"start mqtt test");
MQTT_Client_t* client = MQTT_ClientNew();
MQTT_Connect_Info_t ci;
MQTT_Error_t err;
memset(&ci,0,sizeof(MQTT_Connect_Info_t));
ci.client_id = CLIENT_ID;
ci.client_user = CLIENT_USER;
ci.client_pass = CLIENT_PASS;
ci.keep_alive = 60;
ci.clean_session = 1;
ci.use_ssl = false;
err = MQTT_Connect(client,BROKER_IP,BROKER_PORT,OnMqttConnection,NULL,&ci);
if(err != MQTT_ERROR_NONE)
Trace(1,"MQTT connect fail,error code:%d",err);
while(1)
{
if(isGpsOn)
{
//show fix info
uint8_t isFixed = gpsInfo->gsa[0].fix_type > gpsInfo->gsa[1].fix_type ?gpsInfo->gsa[0].fix_type:gpsInfo->gsa[1].fix_type;
char* isFixedStr;
if(isFixed == 2)
isFixedStr = "2D fix";
else if(isFixed == 3)
{
if(gpsInfo->gga.fix_quality == 1)
isFixedStr = "3D fix";
else if(gpsInfo->gga.fix_quality == 2)
isFixedStr = "3D/DGPS fix";
}
else
isFixedStr = "no fix";
    //convert unit ddmm.mmmm to degree(°)
    int temp = (int)(gpsInfo->rmc.latitude.value/gpsInfo->rmc.latitude.scale/100);
    double latitude = temp+(double)(gpsInfo->rmc.latitude.value - temp*gpsInfo->rmc.latitude.scale*100)/gpsInfo->rmc.latitude.scale/60.0;
    temp = (int)(gpsInfo->rmc.longitude.value/gpsInfo->rmc.longitude.scale/100);
    double longitude = temp+(double)(gpsInfo->rmc.longitude.value - temp*gpsInfo->rmc.longitude.scale*100)/gpsInfo->rmc.longitude.scale/60.0;

    //you can copy ` latitude,longitude ` to http://www.gpsspg.com/maps.htm check location on map

    snprintf(buffer,sizeof(buffer),"GPS fix mode:%d, BDS fix mode:%d, fix quality:%d, satellites tracked:%d, gps sates total:%d, is fixed:%s, coordinate:WGS84, Latitude:%f, Longitude:%f, unit:degree,altitude:%f",gpsInfo->gsa[0].fix_type, gpsInfo->gsa[1].fix_type,
                                                        gpsInfo->gga.fix_quality,gpsInfo->gga.satellites_tracked, gpsInfo->gsv[0].total_sats, isFixedStr, latitude,longitude,gpsInfo->gga.altitude);
    //show in tracer
    Trace(2,buffer);
}

if(OS_WaitEvent(secondTaskHandle, (void**)&event, OS_WAIT_FOREVER))
{
    SecondTaskEventDispatch(event);
    OS_Free(event);
}

OS_Sleep(5000);

}
}
void AppMainTask(void pData)
{
API_Event_t event=NULL;
secondTaskHandle = OS_CreateTask(LoopTask ,
NULL, NULL, SECOND_TASK_STACK_SIZE, SECOND_TASK_PRIORITY, 0, 0, SECOND_TASK_NAME);
while(1)
{
if(OS_WaitEvent(mainTaskHandle, (void**)&event, OS_TIME_OUT_WAIT_FOREVER))
{
EventDispatch(event);
OS_Free(event->pParam1);
OS_Free(event->pParam2);
OS_Free(event);
}
}
}
void app_Main(void)
{
mainTaskHandle = OS_CreateTask(AppMainTask ,
NULL, NULL, MAIN_TASK_STACK_SIZE, MAIN_TASK_PRIORITY, 0, 0, MAIN_TASK_NAME);
OS_SetUserMainHandle(&mainTaskHandle);
}
`
This is compile result:
`[LOD]               D:/Documents/AiThinker/GPRS_C_SDK/hex/app/app_flash.lod
[LODCOMBINE]        Combine with Platform lod
[LODCOMBINE]        Combine sucessful

ROM    total:1048576 Bytes     used:17984 Bytes
RAM    total:1048576 Bytes     used:5168 Bytes
Start Time : 16:11:52.42
End   Time : 16:12:16.39
Build Time : 23.997s
=================================================`
Thx a lot Riccardo, It explains a lot.

authors: CRONOS-IOS CallaDai NathasLab Neutree fewtechiot futechiot mirekhk ricardopera


text:
Need custom data onChange of value

I am using react-picky in loop and displaying multiple dropdowns using package, my requirement is i need custom data onChange of value so i can use it to make generic handleOnChange method. Please suggest how can i get custom data related to dropdown

@Puneetbh I'll need an example, I don't get what you mean.

i have array of objects and with loop i am displaying react-picky dropdown by passing options, now i am passing common generic onchange method to in onChange property, inside that i want to know which dropdon valud changed so i can update state accordingly
Like if country changed by user i want to know user changed country then i will update state of country so want to get some additional data whenever user making selection in dropdown

@Aidurber  i got the solution, Thanks

Hi Aidurber,
I have recently downloaded the picky and have used it inside a map function to loop through my dynamic data. In the picky i have set multiselect as true.
How ever on the onchange function am getting only the currently selected value and not the list of values selected for picky.
This is the sample code:
{
sectorsData.map((selectItem, i) => (

))}
in the on change function  i have written the following code :
const selectedOption = (name,value) =>{
setAssetsAddedState(prev => { return { ...prev, [name] : value}});
}
The issue am facing is in the case of multiselect where the value will be a single object containing the current selected item rather than the list of items selected. Could you please help me with the issue. I have tried every possible solution and it does not seem to work.Any help would be really appreciated as am stuck in the issue for sometime.
Where a sample sectorsData:
[
{
"name": "Technology",
"options": [
{ "id": "1",
"name": "AI & Analytics"
},
{
"id": "2",
"name": "Robotics"
},
{
"id": "3",
"name": "IoT"
}
]
},
{
"name": "Sector",
"options": [
{
"id": "1",
"name": "Automotive"
},
{
"id": "2",
"name": "Oil and gas"
}
]
}
]

source: gharchive/issue

authors: Aidurber Puneetbh priyankaviswan

repo: Aidurber/react-picky

license: MIT

license_type: permissive

license_source: github-api


text:
🛑 Main Site is down

In 793c639, Main Site (https://aksuma.ru/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Main Site is back up in eded89b after 1 day, 7 hours, 49 minutes.

repo: AipNooBest/aksuma-uptime


text:
志愿者报名

你好，我想以志愿者的身份报名参加AIRICS软件测试。我了解一些区块链知识，并有一定的英语基础。
我非常期待能参加这次考试的志愿者们。 #66

copy that
---原始邮件---
发件人: @.>
发送时间: 2021年9月27日(周一) 晚上6:25
收件人: @.>;
抄送: @.@.>;
主题: Re: [Aircoin-official/AirCash] 志愿者报名 (#67)
Closed #67.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

repo: Aircoin-official/AirCash


text:
Fix the image in the Readme.md to better suit dark and light mode users.

The image in the readme of the project file that is : images/The Field of AI in Layers.svg has a transparent background which needs to be changed to a white background in this case, as the labels are black in color and do not change when the user in github is using dark mode, which most use. This problem can be solved by changing the image's backgroud to white that would provide enough contrast to readers.

Thanks

You're welcome.

authors: Aisuko captraj

repo: Aisuko/notebooks


text:
对于GPU服务器需要什么样的配置？

对于GPU服务器需要什么样的配置？
比如内存 cpu GPU等

CPU 推荐4核心， 内存 40GB 及以上，GPU显存 24GB 及以上。

authors: Hans-Wu-cn wukailu


text:
astacus: track remaining restored object files

Track the progress on the remaining object storage files that needs to be copied during RestoreObjectStorageFilesStep.
Expose as gauge astacus_copy_tiered_object_storage_files_remaining_value.
Syncing required with https://github.com/Aiven-Open/astacus/pull/228
Requires rohmu 2.7.0

https://github.com/Aiven-Open/rohmu/pull/192

@dmitry-potepalov thanks for feedback.
comments addressed.

source: gharchive/pull-request

repo: Aiven-Open/astacus


text:
Release 2.14.0.0

OpenSearch 2.14.0 has been released, see release notes.
Official OpenSearch release ticket: https://github.com/opensearch-project/opensearch-build/issues/4562
Checklist:

[ ] Compatibility Matrix is updated (TODO: link to PR)
[ ] Release 2.14.0.0 tag is present in the repo
[ ] Release artifacts are available and downloadable
[ ] Release notes published
[ ] Forum announcement published

Is this a task anyone can help with or is this dedicated to the maintainer of the repo?
Thanks

@vinylen Release is available and you can use it now.
I will close this ticket once I do also release 1.3.16.0 https://github.com/Aiven-Open/prometheus-exporter-plugin-for-opensearch/issues/270 and drop combined announcement into the forums.

Forum announcement: https://forum.opensearch.org/t/prometheus-exporter-plugin-2-14-0-0-and-1-3-16-0-released/19478

authors: lukas-vlcek vinylen


text:
Enhancements about server safety

Idea
Some servers don't install No Chat Reports or some other mods or plugins to prevent reporting(even require signs), but in fact, reports cannot occur on these servers, because there are NO player messages at all, all messages are system messages(These server like Hypixel, EarthMC). The security of these servers is "unintrusive" or "insecure".
Can NCR add a function? If there is no player message on the server(all system messages), the server safety will be safe.
Reasoning
Some servers convert all messages to system messages, but the security of these servers is "unintrusive" or "insecure".
Other Information
No response

Duplicate of #328

repo: Aizistral-Studios/No-Chat-Reports

license: WTFPL


text:
Clearing/purging issue

Type

[ ] Functions: $clear

Example code I used:
$clear[$sum[1;$slashOption[amount];$replaceText[$interactionData[options.data[1].value];undefined;everyone]]

Information:

aoi.js version: v5.1.1-dev

Issue I want to talk about; $clear function still counting sent messages even we use "user" property on it.
Example:
+ Hello!
- Hi!
+ How are you?
- I'm fine, thanks. You?
"+" = A user, "-" = B user
So, if we try to delete "A" user's a message, it won't delete it cause it will also count "B" user's message. Purging A's message will be failed. I'm considering this as bug.

how did u use user property

how did u use user property

Like I showed on example.

authors: NeoAIChan USERSATOSHI


text:
[NOT A ISSUE] Add a select option for selecting a specific frame of a video

or make a option to extract only ONE frame !
thx in advice !

@Felzow47 Done! Added this feature of extracting a specific frame.
(Download the new version)
Just right click on the Extract Button, then select the option Extract specific frame.

repo: Akascape/Vdo-Img-Conversion-Tools


text:
Vendor table empty

The vendow table is always empty. Leases are for HP, Samsung, iPhone. Is there a way to troubleshout this?

This is what the bin\dhcp_utility.pl script is for.
To use it, you need to run bin\dhcp_utility.pl --leases-file /path/to/your/leasefile --parse

authors: Mubaer madtempest

repo: Akkadius/glass-isc-dhcp

license: mit

license_source: bigquery


text:
Is it a stable version?

Hello,
I'm not sure I use the good version because :

I can't install it from f-droid. The only option I have is "Sharing"
In obtainium, that's indicated like a fictive version (first time I see that)
When I install it anyway, I can't give rights to access all files (the checkbox is grey)

Thx for the help
Edit : I'm on GrapheneOS

@github5546 the last build seems to be broken in some ways:

The reason why you might be only seeing sharing on f-droid is because only armv8 is published on izzydroid. armv7 is only on github. No real solution right now. Might be fixed in the future
about obtainium what kind of fictive version does it give?
i need to check this it should work, might be due to the last version being not "right". What s your android version?

I'm on Android 14

Sorry, mistake, I closed it

@github5546 of the name in obtainium is because it reads my github tags for which i have a special format (because i release 3 differents apps: iOS, Android playstore, Android github). It might look weird but it should work within.
I am building a new version. Will test it and report that is correct!

@github5546 here is a fixed version https://github.com/Akylas/conty/releases/tag/android%2Fgithub%2F1.5.5%2F18

It works. Thx!!

repo: Akylas/conty


text:
feat(build): new script that generate extended component files for wca to be able to analyze #85

Alaska Airlines Pull Request
#85
This PR is to create new script that generate extended component files for wca to be able to analyze
Tested on Auro-flight
This change is a part of https://github.com/AlaskaAirlines/auro-flight/pull/139
By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

@sourcery-ai review

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.2 out of 3 committers have signed the CLA.:white_check_mark: chrisfalaska:white_check_mark: sun-mota:x: semantic-release-botYou have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant sun-mota

repo: AlaskaAirlines/auro-library


text:
Set select element height

Alaska Airlines Pull Request
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes: #81, #112
Summary:
Please summarize the scope of the changes you have submitted, what the intent of the work is and anything that describes the before/after state of the project.
Set the height of the dropdown inside of auro-select to use the new var(--auro-size-500) design token or a value of 40px when the variable is not defined.
Type of change:
Please delete options that are not relevant.

[ ] New capability
[x] Revision of an existing capability
[ ] Infrastructure change (automation, etc.)
[ ] Other (please elaborate)

Checklist:

[x] My update follows the CONTRIBUTING guidelines of this project
[x] I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.
Thank you for your submission!
-- Auro Design System Team

:tada: This PR is included in version 2.5.4 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

repo: AlaskaAirlines/auro-select


text:
Add ECIES Poseidon encryption

Motivation
This PR supples the ECIES Poseidon encryption, which is likely going to replace group encryption.
Currently the group encryption has certain challenges: (1) elligator is not performing ideally for a few reasons and (2) it seems to complicate our serialization.
This one supplies an ECIES Poseidon encryption, which is likely to be faster than the group encryption, and can work securely when the same key is also used with Schnorr signatures.
There is a possibility of using ElGamal hybrid encryption later, which will also be using Poseidon for the symmetric encryption part, and can reuse the code here.
Test Plan
The ECIES Poseidon uses the same tests as used by group encryption.

Putting this into DPC will require a massive change to the record part, since the record part has been specifically designed to embed data into group elements. It would be done after a few other PRs that unify the testnet1 and testnet2 DPC.

LGTM, this PR doesn't plug into the existing record model yet, so there is no need to resample parameters for this PR.

authors: howardwu weikengchen

repo: AleoHQ/snarkVM


text:
Inserting a link with a selected text of a list element is broken

Informations
Browser version: Google Chrome 71
OS: Win 10
Screen resolution: 1920x1080
How to reproduce the bug?
Make a bulleted list of a few items. Select the text of an item, select insert link. The dialog that opens up will has an URL field and a text field. The Text field is pre-filled with the html code of the list element(s), in my case:

sdfsdf

Actually inserting the link after does some very weird stuff to the list.
Looks to me like whatever piece of code finds the currently selected text does not properly match that stuff

I came here to report a similar issue.
I'm using Firefox.
Add a link
Double-clicking the link text selects all of the text.
Go to Insert Link.
That w3.org text appears in the Text field, and URL field is empty.
Click Cancel
Link text is still selected/highlighted
Go to Insert Link again, without having changed the text selection
Link URL and Text fields have the correct values.
Kinda weird.
Same thing applies in Chrome except you triple-click to select all of the text.

It'd be cool too if double-clicking a link would open the Insert Link dialog, the way double-clicking an image opens its dialog

I too am having this same issue, in Firefox.
If I click the link once it works fine, if I select the text it also works fine. If I double click the link it says the documentSelection's range is
startContainer: div.trumbowyg-editor, startOffset: 1, endContainer: div.trumbowyg-editor, endOffset: 2, collapsed: false, commonAncestorContainer: div.trumbowyg-editor

Should be fixed in 2.22

authors: Alex-D Discartyptics kurupted tyronx

repo: Alex-D/Trumbowyg


text:
Keep some styling.

Keep background-color, color, font-size while pasting content.
Undo changes from previous commit.

The goal of cleanpaste is to remove all of that. So I will not merge since it can be considered as a bug for other users.

Thanks for review anyway!

authors: Alex-D alex-dolzhok


text:
Sign in to Thorium with an email account.

When wanting to sign in (in Thorium browser) with an email account, in order to get back all my personal stuff (bookmarks, passwords, etc), Thorium asks for the actual password of the email concerned. In every other browser I've used, you choose a different password!
For privacy reasons, this is a definite NO NO!. If the developer has read this, then change the sign in feature!
Lastly, why on earth would Thorium, a 'privacy' conscious browser, choose Google search as the default browser?. Makes no sense.

Are you trying to import bookmarks and passwords from another browser or sign in to your Google account?

Are you trying to import bookmarks and passwords from another browser or sign in to your Google account?

I normally use Opera and Firefox browsers. In both browsers I have all my passwords and bookmarks backed up in one of my google accounts. However, unlike Thorium, those other browsers allow me to create a different password in order to access my email account which has my backups. With Thorium, I am forced to use the original password of that email account.. This is a privacy issue.

Try it manually

Export from Firefox
Import to Thorium/Chrome

authors: Lapingaman Lapingaman32 ttheek


text:
ubuntu 20.04 hardware video decode is not working.

Thorium info: Version 105.0.5183.0 (Official Build) unstable, built on Ubuntu 22.04, running on bullseye/sid (64-bit)
system info: ubuntu 20.04 x64
CPU: Intel(R) Core(TM) i5-8350U

from setting page, hardware acceleration is enabled.

from chrome://gpu page, hardware video decode is enabled.

use enhanced-h264ify only enable h264.

checked the media info while playing video, FFMpegVideoDecoder used.

monitored with intel_gpu_top, Video decode always 0.00%

confirmed Firefox hardware video decoding is working.

Any suggestions? Thanks in advanced.

@chenzaichun  Do you have chrome://flags/#ignore-gpu-blocklist and chrome://flags/#enable-gpu-rasterization enabled. What GPU do you have, and are you using X11 or wayland.

@chenzaichun
On intel igpu you must have installed non-free driver, install from official intel page https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-focal.html
Also, if you don't have installed, install va-driver-all from default ubuntu repository.
It should be work out of the box. Thorium is the first browser based on chromium when the hardware accelerate(ubuntu 20.04 X11) working without combinable with flags for me. On the amd gpu you don't need official driver.

@chenzaichun Do you have chrome://flags/#ignore-gpu-blocklist and chrome://flags/#enable-gpu-rasterization enabled.
yes, both ignore-gpu-blocklist and `enable-gpu-rasterization are enable.

What GPU do you have, and are you using X11 or wayland.

#  sudo lshw -C display
  *-display
       description: VGA compatible controller
       product: UHD Graphics 620
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 07
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:137 memory:eb000000-ebffffff memory:a0000000-afffffff ioport:f000(size=64) memory:c0000-dffff

Ubuntu 20.04 with x11.

@chenzaichun On intel igpu you must have installed non-free driver, install from official intel page https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-focal.html Also, if you don't have installed, install va-driver-all from default ubuntu repository. It should be work out of the box. Thorium is the first browser based on chromium when the hardware accelerate(ubuntu 20.04 X11) working without combinable with flags for me. On the amd gpu you don't need official driver.

Already installed.
# sudo apt install va-driver-all
Reading package lists... Done
Building dependency tree
Reading state information... Done
va-driver-all is already the newest version (2.7.0-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Still cannot get hardware video decoding working. (Firefox works perfect)

@chenzaichun
What version intel-media-va-driver-non-free you have installed?
$ sudo apt list --installed |grep intel-media-va-driver-non-free

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

intel-media-va-driver-non-free/focal,now 22.4.3+i755~u20.04 amd64 [zainstalowany]

@chenzaichun What version intel-media-va-driver-non-free you have installed? For me this look like below:
$ sudo apt list --installed |grep intel-media-va-driver-non-free

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

intel-media-va-driver-non-free/focal,now 22.4.3+i755~u20.04 amd64 [zainstalowany]

@Apogeum12 Thanks a lot. It's working now after installed intel-media-va-driver-non-free .


text:
Refactored some sh files with python and rewrote some instructions

Delete the *.bat files in the win_scripts directory. These files have not been updated for a long time and are not convenient to use.

Rewrite some sh files with python, currently only for the parts applicable to Windows.

Removed some outdated guidelines and updated some guidelines.

This is a non-trivial change, please feel free to review and test it. lol
@Alex313031

@gz83 Can you please restore the .bat files, and place them in a new "old" dir.
i.e. Make a dir in //win_scripts called "old" > //win_scripts/old
Then place all the files except the readme into that  dir.

@gz83 Can you please restore the .bat files, and place them in a new "old" dir.
i.e. Make a dir in //win_scripts called "old" > //win_scripts/old
Then place all the files except the readme into that dir.

Done

@gz83 Also, thanks for using spaces for indentation, instead of tabs like the sh files use.


text:
[Feature Request] Ability to view thumbnail of Image files

Hello. Some people may need this feature for exploring pictures or images using this tool.

Yes, that definitely could be a great feature.
The problem is that in order to display an image, it needs to be transferred first to the PC.
I also can't get the image in a smaller resolution to speed up the process.
So in order to display thumbnails for every picture in a folder - all of the pictures in that folder will need to be pulled to the PC, at which point you will be able to view all of them in the File Explorer anyway.
The only thing I see value in adding is displaying an image that you selected. This image still needs to be pulled to the PC, but this way you can select images one after the other, while keeping the data transfers to a minimum.

Yeah, I understand now. Sorry for interrupting.


text:
Campaign id cannot be less than 1 Error

Getting the following error:
2023-09-18 19:07:56.1702 FATAL Fatal error, application will be closed: UniversalDownloaderPlatform.Common.Exceptions.UniversalDownloaderException: Unable to retrieve crawl target info: Campaign id cannot be less than 1 (Parameter 'campaignId')  ---> System.ArgumentOutOfRangeException: Campaign id cannot be less than 1 (Parameter 'campaignId')    at PatreonDownloader.Implementation.PatreonCrawlTargetInfoRetriever.GetCrawlTargetInfo(Int64 campaignId) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.Implementation\PatreonCrawlTargetInfoRetriever.cs:line 58    --- End of inner exception stack trace ---    at PatreonDownloader.Implementation.PatreonCrawlTargetInfoRetriever.GetCrawlTargetInfo(Int64 campaignId) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.Implementation\PatreonCrawlTargetInfoRetriever.cs:line 75    at PatreonDownloader.Implementation.PatreonCrawlTargetInfoRetriever.RetrieveCrawlTargetInfo(String url) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.Implementation\PatreonCrawlTargetInfoRetriever.cs:line 26    at UniversalDownloaderPlatform.Engine.UniversalDownloader.Download(String url, IUniversalDownloaderPlatformSettings settings) in F:\Sources\BigProjects\PatreonDownloader\submodules\UniversalDownloaderPlatform\UniversalDownloaderPlatform.Engine\UniversalDownloader.cs:line 183    at PatreonDownloader.App.Program.RunPatreonDownloader(CommandLineOptions commandLineOptions) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.App\Program.cs:line 128    at PatreonDownloader.App.Program.Main(String[] args) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.App\Program.cs:line 68

+1 here...

Same problem:
2023-09-19 10:43:24.9759 FATAL Fatal error, application will be closed: UniversalDownloaderPlatform.Common.Exceptions.UniversalDownloaderException: Unable to retrieve crawl target info: Campaign id cannot be less than 1 (Parameter 'campaignId')

same here

Created a PR that I believe fixes this issue
https://github.com/AlexCSDev/PatreonDownloader/pull/197

Also confirmed that it works when built from source code per build instructions with that PR implemented

Also confirmed that it works when built from source code per build instructions with that PR implemented

a big thanks!

Created a PR that I believe fixes this issue
#197

With the PR it is working now.
Thanks

Sorry i'm new to this. I have forked my own copy and modified the code as directed by Skyl3lazer. How do I compile everything in this fork into an executable to be able to run/use it?

Read the build instructions as directed by the readme. It's another
document in the docs folder.
On Tue, Sep 19, 2023, 9:13 PM IceySnowman @.***> wrote:

Sorry i'm new to this. I have forked my own copy and modified the code as
directed by Skyl3lazer. How do I compile everything in this fork into an
executable to be able to run/use it?
—
Reply to this email directly, view it on GitHub
https://github.com/AlexCSDev/PatreonDownloader/issues/196#issuecomment-1726740399,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABQYWEQFOSYAYCIHEPPJO5DX3I7MNANCNFSM6AAAAAA45NQMKY
.
You are receiving this because you authored the thread.Message ID:
@.***>

I've spent a few hours trying to get this to work & keep failing in various different ways. Until AlexCSDev is able to return, could anyone please consider providing me with the amended "PatreonDownloader.Implementation.pdb" file or entire amended net6.0-win-x64-release.zip?

I also tried compiling it according to the instructions but only got errors, I'm a complete noob mind you.
Would appreciate if someone could share it.

I also tried compiling it according to the instructions but only got errors, I'm a complete noob mind you. Would appreciate if someone could share it.

Sure thing.
debug-net6.0.zip

Thank you!

I've spent a few hours trying to get this to work & keep failing in various different ways. Until AlexCSDev is able to return, could anyone please consider providing me with the amended "PatreonDownloader.Implementation.pdb" file or entire amended net6.0-win-x64-release.zip?

https://github.com/AlexCSDev/PatreonDownloader/files/12675516/debug-net6.0.zip

Thank you, lifesaver!

for everyone who wants to compile it from source while it isnt fixed use this to clone the repo: git clone https://github.com/Skyl3lazer/PatreonDownloader -b patch-1 --recursive

Thank you

anyone can share a fixed build for linux, thx a lot!

@jefflaunmg just build it yourself build -c release

What am I supposed to do with the debug-net6.0 file?

@jdragoon nothing, download @Skyl3lazer fox and follow the instructions in the readme

Should be fixed in release 26/27, thanks to Skyl3lazer for the fix!

authors: AlexCSDev JustFrederik Mustached-Man Skyl3lazer ToninoTarsi YakudzaKY aa7326aa11 aksskl angramainyuu icedstick jdragoon jefflaunmg

repo: AlexCSDev/PatreonDownloader


text:
Updated makefile, CMakeLists, uploaded refactored LLL file

Proposed changes
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
Types of changes
This is the first PR in a major refactor of the Linear Linked Lists class. During the course of taking a data structures course over the summer I had reworked the LLL from the ground up. This version of the LLL is faster, optimized, and hopefully generally more readable and organized.

[x] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

[x] I have read the CONTRIBUTING doc
[x] Unit tests pass locally with my changes
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have added necessary documentation (if appropriate)

Codecov Report

Merging #59 into master will decrease coverage by 4.41%.
The diff coverage is 95.58%.

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage     100%   95.58%   -4.42%
==========================================
  Files           2        3       +1
  Lines         731      181     -550
==========================================
- Hits          731      173     -558
- Misses          0        8       +8

Impacted Files
Coverage Δ

src/linked_list.h
100% <100%> (ø)

tests/linear_list_test.cpp
100% <100%> (ø)

src/linked_list.cpp
92.3% <92.3%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ae0de1...e4cf874. Read the comment docs.

authors: AlexanderJDupree codecov-io

repo: AlexanderJDupree/LinkedListsCPP


text:
Improve CI build times

Should be the last one for today :)

@Alexays forgot to mention, can you please update the container images?

@Alexays I think you've accidentally pushed an arm64 image instead of amd64. That's the cause of CI breakage in #2944

Oups, should be good now, thx

Hmm, that accidentally broke clang-tidy action. Sorry :(
/__t/Python/3.11.8/x64/bin/python: error while loading shared

libraries: libpython3.11.so.1.0: cannot open shared object file: No such
file or directory
I thought it won't be affected because they use actions/setup-python action
internally, but apparently they don't set the LD_LIBRARY_PATH, thus the
installation they got via actions/setup-python cannot find its own library
and relies on a system libpython.
Adding libpython3.11 to the container image could help. Or updating the
cpp-linter action to the latest release (v2.9.1) and adding libpython3.10

authors: Alexays alebastr

repo: Alexays/Waybar


text:
Italic comments

Is it possible to disable italic comments(in old version)?

Yeah, maybe I'll add option later because I'm flooded with projects in our school.

Hi, I implemented it now check this commit d24275a. I also tried to improve it. Hope it works. Sorry, that I removed it.

Hi, I implemented it now check this commit d24275a. I also tried to improve it. Hope it works. Sorry, that I removed it.

Thx, great colorscheme!


text:
Switches not responding

everything was fine but one day switches become non responsive and found following 2 errors in log
Log Details (ERROR)
Logger: custom_components.sonoff
Source: custom_components/sonoff/init.py:154
Integration: Sonoff (documentation)
First occurred: 2:01:20 PM (1 occurrences)
Last logged: 2:01:20 PM
Device 1000123456 not found
Log Details (WARNING)
Logger: custom_components.sonoff
Source: custom_components/sonoff/init.py:378
Integration: Sonoff (documentation)
First occurred: 12:00:48 PM (13 occurrences)
Last logged: 2:00:08 PM
Can't send switches to 10005e888b
Home Assistant 0.109.6 installed on ven on RPI 3 Model B
Sonoff LAN  Installed: v1.10.4

Try new version #99

Version 2 should handle all the problems.

authors: AlexxIT drk-geek

repo: AlexxIT/SonoffLAN


text:
Interfering with Android widgets?

https://community.home-assistant.io/t/unable-to-configure-a-widget/293451/22?u=hangryman250
With this integration installed, Android widgets do not seem to work.
It prevents the service (now called action) data from loading.

I don't see how widgets on a phone can be related to Hass integration. This or any other.

i found it prevents actions loading in android widgets , this is the log i fetch in android app

repo: AlexxIT/StreamAssist


text:
Integration not loaded

Log
Logger: homeassistant.setup
Source: setup.py:210
First occurred: 19:58:49 (1 occurrences)
Last logged: 19:58:49
Setup failed for custom integration xiaomi_gateway3: Unable to import component: cannot import name 'Command' from 'zigpy.zcl.foundation' (/usr/local/lib/python3.10/site-packages/zigpy/zcl/foundation.py)

I have the same issue after upgrading to Home assistant Core to 2023.1.2

The BLE devices were restored after updating to the beta version [v3.0-alpha.1].
But now, all my zigbee devices agora not connecting to the gateway. The Mi Home app shows the same.
BLE devices ok
Zigbee devices NOK

I downgraded from beta version [v3.0-alpha.1] to stable v2.1.2.
Full restore from before the beta, and before HA core2013.1.2.
From the gateway only had data from de BLE devices (thermometers). No zigbee devices were connected.
Exactly the same symptom on the Mi Home app. Only BLE devices available.
I checked the gateway and notice a very slow blink on the blue light. Rebooted the gateway.
All maintained the same.
I was think about re-pair a device to test but all of the sudden, I notice 1 zigbee device with online status (on Mi Home).
Then i started to trigger them, open/close door sensor, clicking a smart switch etc and all of them re-connect and are now online on Mi Home and HA.
Somehow, either the v3.0-alpha or HA core2013.1.2... messed up the gateway and it needed to be 'shaken' :)

Log
Logger: homeassistant.setup Source: setup.py:210 First occurred: 19:58:49 (1 occurrences) Last logged: 19:58:49
Setup failed for custom integration xiaomi_gateway3: Unable to import component: cannot import name 'Command' from 'zigpy.zcl.foundation' (/usr/local/lib/python3.10/site-packages/zigpy/zcl/foundation.py)

same thing here:
Logger: homeassistant.setup
Source: setup.py:210
First occurred: 19:58:16 (1 occurrences)
Last logged: 19:58:16
Setup failed for custom integration xiaomi_gateway3: Unable to import component: cannot import name 'Command' from 'zigpy.zcl.foundation' (/usr/local/lib/python3.10/site-packages/zigpy/zcl/foundation.py)

#911


text:
Cannot get ffmpeg to work - An established connection was aborted by the software in your host machine (Solved)

I am using ffmpeg version 2024-09-22, go2rtc version=1.9.4
I have the following, which works:
   streams:
     cam3:
       type: rtsp
       url: rtsp://10.0.0.45:80/ch2_0.264
       control: false
       record: false
       options:
         reconnect: true
         reconnect_interval: 60 # seconds
         max_retries: 5

Now, I want to handle this with ffmpeg. According to the documentation, with the format being ffmpeg:{input}#{param1}#{param2}#{param3} the following simple stream should work:
test: ffmpeg:rtsp://localhost:8554/cam3
But I am getting the error: error="read tcp 127.0.0.1:8554->127.0.0.1:50731: wsarecv: An established connection was aborted by the software in your host machine."
Now the following works:
  test:
     type: ffmpeg
     url: rtsp://localhost:8554/cam3

But I cant apply operations like #rotate=90 or `options: rotate: 90' to work
The following doesnt work either:
test: ffmpeg:rtsp://10.0.0.45:80/ch2_0.264
My end goal is to create a new rtsp stream by taking 4 camera streams, cam1, cam2, cam3 and cam4 and applying the following: -filter_complex "[0:v][1:v]hstack[top];[2:v][3:v]hstack[bottom];[top][bottom]vstack"
I want to use the camera stream created by go2rtc as opposed to from the camera source because I need the functionality of reconnect_interval.
I have ensured both go2rtc.exe and ffmpeg.exe are in windows antivirus and firewall exclusion list
But I'm failing at basically step two, getting ffmpeg to work

Okay so through lots of testing I figured it out. This stream formatting for ffmpeg works:
  test_scale: #native is 2560x1440
    - ffmpeg:cam1#video=h264#width=1280#height=720

You need to have video set to something otherwise you cant transcode a stream copy.
So then I started playing around with custom formats. Although I couldnt manage to create my new format, I could override existing ones.
Previously RTSP looked like this:
https://github.com/AlexxIT/go2rtc/blob/master/internal/ffmpeg/ffmpeg.go
This is what I turned it into, note that go2rtc doesn't actually handle multi-line strings right, so this would all be one line, i just added indentation so its legible:
ffmpeg:
  rtsp: >
		-fflags nobuffer
		-flags low_delay
		-timeout 5000000
		-thread_queue_size 512
		-user_agent go2rtc/ffmpeg
		-rtsp_flags prefer_tcp
	-i rtsp://localhost:8554/cam1
		-fflags nobuffer
		-flags low_delay
		-timeout 5000000
		-thread_queue_size 512
		-user_agent go2rtc/ffmpeg
		-rtsp_flags prefer_tcp
	-i rtsp://localhost:8554/cam2
		-fflags nobuffer
		-flags low_delay
		-timeout 5000000
		-thread_queue_size 512
		-user_agent go2rtc/ffmpeg
		-rtsp_flags prefer_tcp
	-i rtsp://localhost:8554/cam3
		-fflags nobuffer
		-flags low_delay
		-timeout 5000000
		-thread_queue_size 512
		-user_agent go2rtc/ffmpeg
		-rtsp_flags prefer_tcp
	-i rtsp://localhost:8554/cam4
	-filter_complex '[0:v][1:v]hstack[top];[2:v][3:v]hstack[bottom];[top][bottom]vstack'"

And this gives me exactly what I wanted:

Closing because solved. It's better to use exec source when you using so complex ffmpeg params.

I hope you can give me a tutorial to show me how to play multi-screen videos like the pictures in your message. Thank you

authors: AlexxIT catboyschrody yhxiaoh


text:
added accessibility on login page

#REF: #MOBILEAPPS-1505

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Ankit Goyal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant ankitgoyalgloballogic

repo: Alfresco/alfresco-mobile-workspace-ios


text:
Implementation of the nonblocking backend

@anyzelman Could you please review the branch for the nonblocking backend and merge into develop?

Just to document the review strategy:

only cursory code style checks on files in include/graphblas/nonblocking;
in-depth review of all other files.

Testing requirement aside from CI OKs are to pass the full test suite with LPF.

Concept merge notes:
This MR re-implements and releases the nonblocking ALP/GraphBLAS backend presented by Aristeidis Mastoras et al. [1,2] on top of the current develop branch.
Additionally, it includes the following improvements:

reworks the build infrastructure to be a bit more modular in terms of packaging new backends into existing libraries;
as a happy side-effect, removes an earlier CMake work-around that due to the above change no longer is required;
revised specification of eWiseLambda, in particular, specifies additional constraints on the use of eWiseLambda (only calling operator[] on captured ALP vectors is allowed, any other use of the captured ALP vectors is not);
introduces the isBlockingExecution and isNonblockingExecution static constexpr const properties to grb::Properties<>;
introduces a test of grb::Properties and makes sure base properties class is now empty, forcing backends to specialise it;
hardens some tests against the possibility of nonblocking execution;
hardens the GitHub CI by printing the full log even if test script itself fails;
adds missing file headers to the k-core decomposition algorithm header; and
improves code documentation and code style issues throughout the code base.

The nonblocking backend exposed the following bugs, which this MR fixes:

fix missing containers to call to eWiseLambda in pregel.hpp and bicgstab.hpp;
the hyperdags backend erroneously did not provide a specialisation to grb::Properties;
the sparse_vxm unit test erroneously did not pass one of its captured vectors as an argument to eWiseLambda; and
the vmx and vmxa unit tests depended on internal functions.

[1] Design and implementation for nonblocking execution in GraphBLAS: tradeoffs and performance
by Aristeidis Mastoras, Sotiris Anagnostidis, and A. N. Yzelman, ACM Transactions on Architecture and Code Optimization 20, 1, Article 6 (March 2023).
[2] Nonblocking execution in GraphBLAS
by Aristeidis Mastoras, Sotiris Anagnostidis, and A. N. Yzelman in 2022 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), pp. 230-233, IEEE (2022).

Waiting for internal CI OK before merge.
GitHub CI and smoke tests + LPF are OK. On the penultimate version, furthermore, the full test suite with LPF (2390 tests) passed.

All test OK, will merge

authors: anyzelman aristeidis-mastoras

repo: Algebraic-Programming/ALP


text:
Tikz (to_tikz) does not render some labels

I noticed that greek letters aren't showing up in tikz wiring diagrams. Similarly, unicode like \otimes is not rendered.

Currently no effort is made to translate Unicode symbols into their LaTeX counterparts, so if your symbols are Unicode, I figure that they will only show up properly if LaTeX is configured to support Unicode.
One thing that you can always do is put the LaTeX commands directly into the generator names, e.g.
α = Hom("\\alpha", X, Y)

This is a bit hacky but it works. I wonder if Julia's builtin LaTeX -> Unicode table could be reverse-indexed to do this more automatically?

Going to close this for now. Feel free to ping me or the catlab channel if you can't get this working.

authors: epatters sjbreiner


text:
docs(build): removed the unnecessary js files

docs(build): removed the unnecessary js files
Signed-off-by: Ali Sajid Imami 395482+AliSajid@users.noreply.github.com
build: update the blast radius for prettier
Signed-off-by: Ali Sajid Imami 395482+AliSajid@users.noreply.github.com
docs(build): remove the unnecessary default docusaurus images
Signed-off-by: Ali Sajid Imami 395482+AliSajid@users.noreply.github.com
docs(reuse): added license information to the repository for REUSE compliance
Signed-off-by: Ali Sajid Imami 395482+AliSajid@users.noreply.github.com
docs: update documentation subdir readme
Signed-off-by: Ali Sajid Imami 395482+AliSajid@users.noreply.github.com
fix(deps): update docusaurus monorepo to v3.6.2
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows
docs: add JSDoc documentation to the functions
ci: harden security for the sonar-cloud and scorecard workflows

#468
#467
#466  👈 (View in Graphite)
next

This stack of pull requests is managed by Graphite. Learn more about stacking.

Merge activity

Nov 21, 11:39 AM EST: A user started a stack merge that includes this pull request via Graphite.

repo: AliSajid/random-wait-action