Giter VIP home page Giter VIP logo

Comments (24)

Thalhammer avatar Thalhammer commented on September 27, 2024 1

https://gist.github.com/Thalhammer/b60ccbe7d8777debd2ce43796791ce17

This is what I had as a not yet commited example. Not sure if it worked back than but it might be a good starting point.

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024 1

https://cloud.google.com/iot/docs/how-tos/mqtt-bridge#using_a_long-term_mqtt_domain
Download long-term primary and backup for "mqtt.2030.ltsapis.goog"
https://pki.goog/gtsltsr/gtsltsr.crt
https://pki.goog/gsr4/GSR4.crt
Convert to PEMs

Store CA list - SSL_Store from PEMs[2]

CIPHER = "ECDHE-ECDSA-AES128-GCM-SHA256

sni_Name = mqtt.2030.ltsapis.goog

Create JVT mqtt.password from your google private key

If not have Qualcomm API bugs, MQTT will ok

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024 1

yes, sorry
JWT
I use this:
https://github.com/GoogleCloudPlatform/google-cloud-iot-arduino/tree/master/src
Look at google git for C version

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024 1

hints:
https://github.com/Wiz-IO/framework-quectel/blob/master/arduino/libraries/bg96/Ethernet/src/txMqtt.h

https://github.com/Wiz-IO/platformio-quectel-examples/blob/master/Arduino/bg96/bg96_amazon_mqtt/src/main.cpp

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024 1

👍 enjoy :)
if you find bugs ... please contact me

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

thanks! I will try it out, I'm trying to make it work with google cloud iot

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

thank you! By JVT you mean JWT(JSON web token)?

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

Giving an update to the situation:

-Tried to connect to AWS cloud and wasn't successfull, converted the certificates with sharkssl and tried different combinations but nothing seems to work. The mqtt client connects but when it gets to the connect callback it gives "QAPI_NET_MQTT_CONNECT_FAILED_E", it looks like some sort of timeout operation happens.

-Tried with AT commands without success too.

Can't determine the causes, thought it was because of RTC not being up to date but concluded it's not, probably some bug with ssl and mqtt. So at this point im considering changing to another module.

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

that`s mean:

  • key and cert files is wrong
  • ssl config is wrong
  • mqtt-client-id not exest
  • Qualcomm ssl-mqtt ca_root bug...

Amazon-MQTT is very easy with ThreadX
https://www.linkedin.com/feed/update/urn:li:activity:6542386189587095552

from simcom_dam.

Thalhammer avatar Thalhammer commented on September 27, 2024

@mocasrhey How did you convert the certs ?

I might look into it but I never found the tool to convert the certs into the required format.

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

windows - 2 click - details - copy to file - export wizard .... to pem

from simcom_dam.

Thalhammer avatar Thalhammer commented on September 27, 2024

@Wiz-IO I know how to convert to pem, but the simcom modules use a different file format which is somehow property to their ssl stack.

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

AWS - MQTT
Amazon IoT Core - Manage
Create Thing and Certificates, download it and Activate
Policies Allow
Interact - get HTTPS URL for host name

module API
store KEY and CERT (from Amazon) to SSL store as QAPI_NET_SSL_CERTIFICATE_E and "filename"

MQTT SSL basic config....
for cert filename use filename from store
for ca_root file name use ..... string "empty" ... not NULL (workaround)

connect ... enjoy

ps: basic ( qapi ) format is pem (text)

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

They use sharkssl, you need to convert the CA file to binary format, the client certificate and private key combine into one binary file too. I downloaded the tool here: https://realtimelogic.com/downloads/sharkssl/

you then go into the bin folder and you have the tools to do that.

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

https://github.com/Wiz-IO/framework-quectel/blob/master/threadx/bg96/SDK2/qapi/qapi_ssl.h#L456

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

yes i noticed that too, i used that function too but still nothing

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

Forgot to mention, when i atribute more than 1 cipher the module crashes at "qapi_Net_MQTT_Connect()" function and reboots.

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

crash is from other as NULL

ssl_cfg.cipher[] max is 8, can be cleared ( example for Azure not need ) - tested...
ssl-mqtt is tested from me with aws, google, azure, eclipse...

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

yes, even with only 2 ciphers it crashes.
Did you configure all ssl_cfg fields or leaved something as NULL?

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

AZURE
Untitled

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

AMAZON
amazon

from simcom_dam.

Wiz-IO avatar Wiz-IO commented on September 27, 2024

GOOGLE
google

from simcom_dam.

mocasrhey avatar mocasrhey commented on September 27, 2024

UPDATE 2

  • @Wiz-IO I used your delevopment platform for platformIO and successfully connected to AWS IoT. Your platform is portable to SIM7000E too.

Seems like that the error in my code is that the certificates aren't being stored on the variables, will try to fix that.

@Wiz-IO, @Thalhammer, thank you for your support, you guys are amazing 👍

from simcom_dam.

felixback84 avatar felixback84 commented on September 27, 2024

Hello guys I have an ESP32 LilyGo T-Call SIM800 Series module with GSM and I want to send messages from it to GCP's IoT Core, for this I have used two TinyGSM libraries and
Google_Cloud_IoT_Core_JWT. Both do have been useful separately, that is, with TinyGSM I have managed to send messages via GSM to a server (using the examples it brings) and with Google_Cloud_IoT_Core_JWT I have managed to send MQTT messages via WiFi to GCP's IoT Core. However, the problem is when I try to do both at the same time. Since I always have the same error (the return returned is: Settings incorrect or missing a cyper for SSL) I have read this post and the one associated with it carefully and I understand that it is normal to use the Google_Cloud_IoT_Core_JWT library since it cannot establish a secure connection between the device and GCP, as I have seen and with I have investigated has something to do with the secure connection using an SSL certificate. Reading the comments of @Wiz-IO I have tried to intuit things, but nevertheless I have not been able to make it work, since although I know that he has succeeded, I cannot fully spin his suggestions on how to solve it, please do know What should I do? I ask you to help me, since it is important for a project of my company. For me everything happens in this part of the code.

I take this code extract from the related post since I have tried to do almost exactly the same thing, with the same results

Client* client = new TinyGsmClient(modem);
setupCloudIoT(client);

void setupCloudIoT(Client * _tinyGSMClient) {
    device = new CloudIoTCoreDevice(
    project_id, location, registry_id, device_id,
    private_key_str);
         
    netClient =  _tinyGSMClient;
    mqttClient = new MQTTClient(512);
    mqttClient->setOptions(180, true, 1000); // keepAlive, cleanSession, timeout
    mqtt = new CloudIoTCoreMqtt(mqttClient, netClient, device);
    mqtt->setUseLts(true);
    mqtt->startMQTT();
}

the return returned is: Settings incorrect or missing a cyper for SSL

Thank you in advance in case any of those present in these post have managed to solve it

@Wiz-IO I can have a more complete view of this piece of code or some further explanation, it is that especially in the final (begining in mqtt.secured()) part I do not know where the value of the variables comes from, many many tanks already:

#9 (comment)

from simcom_dam.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.