-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
google_iot_mqtt sample does not work with qemu_x86 out of the box #14790
Comments
I agree that the google_iot_mqtt doc could be better. For example, regarding CONFIG_CLOUD_AUDIENCE , this web page : https://cloud.google.com/iot/docs/how-tos/credentials/jwts ... states : aud ("Audience"): This must be a single string containing the cloud project ID where the device is registered Also, under "requirements", the docs say "Google IOT Cloud credentials and required information" ... probably good to have a link to "gcloud iot devices create" page : https://cloud.google.com/sdk/gcloud/reference/iot/devices/create Also, the "device" parameter to "create_keys.py" has to match string in CONFIG_CLOUD_CLIENT_ID ... and probably CONFIG_CLOUD_PUBLISH_TOPIC (I got an error : "could not publish, error -128" ... so something is broken). |
AFAIK there were no fixes/changes in this area. |
TLDR; This example seriously lacks documentation. Yes, there are issues in this example. The most critical part is what @rlubos mentioned in regards to the absence of documentation on configuration options. Obviously, some nerd would say: pfff, read the docs. No. First of all, Google Cloud documentation is MASSIVE, and I feel like looking for a needle. Second, for example, Client ID has a format of I constantly getting connection errors, don't know how to proceed, and would appreciate if someone could have a look at this sample and at least provide a working scenario or short description on how to get this thing working. |
Let me see if I can get this working again. I was able to get it working last time I tried, which was at least a few months ago. |
First thing I've discovered is that 0fa86cb removes CONFIG_LEGACY_TIMEOUT_API as being selected by the net code. It'd probably be best to make this sample work without the legacy timeout api, but it can be made to at least compile by enabling this in the prj.conf for the sample. |
@dieselburner Does #25108 help you get this working? The instructions in the README.rst were somewhat difficult to follow (and even downright wrong). |
I would love to test on master, but blocked by #25140 |
It is just documentation and |
This was merged already so closing. |
Thanks, I got it working because of your changes. |
I've been testing
google_iot_mqtt
withqemu_x86
and it does not work out of the box. In order to make it work I've needed to add the following lines to the project configuration:While the first two configs are totally understandable, I have no clue why did I need to set
CONFIG_NET_CONFIG_MY_IPV4_ADDR
even thoug DHCP leased address was used. I did not dig any further though.Additionally, compared to Zephyr networking guide, a more generic rule for
iptables
had to be added in order to allow DHCP leased addresses to reach the internet:Some afterthoughts regarding documentation, from a GCloud newbie point of view:
iptables
rule),projects/{project-id}/locations/{cloud-region}/registries/{registry-id}/devices/{device-id}
Especially for CLOUD_AUDIENCE - it's simply a project-id. It'd be good to make it clear, as this is vital for device authentication.
create_keys.py
script - it's super convenient, that's for sure. But I found it confusing, that by default it generatesRSA
keys, while default sample configuration expectsECDSA
key. I think this should be stressed out in the docs, especially that no warning is shown if RSA key is used. Cloud server will reject the device in this case, which does not provide too much information, beside that something is wrong.The text was updated successfully, but these errors were encountered: