Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Conversation

@verkri
Copy link
Contributor

@verkri verkri commented Mar 11, 2019

Reason for this PR: I was playing with the examples and found many issues that potential clients might hit as well. These are:

  • Inconsistent logging in binaries,
  • unbuildable iot_core_mqtt_client,
  • Potential Build errors when building multiple examples (TLS platform incompatibility),
  • Inconsistent style of comments in code,
  • Brittle Makefiles.

I went on and moved all IoT Core parameters into a struct for better encapsulation, which resulted also in a refactor in the common libraries.

@verkri verkri marked this pull request as ready for review March 11, 2019 17:53
@verkri verkri requested a review from atigyi March 11, 2019 17:53
Copy link
Contributor

@atigyi atigyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. @soyrice PTAL on the READMEs, thx.

cd iot-device-sdk-embedded-c
```

1. Generate a [public/private key pair](https://cloud.google.com/iot/docs/how-tos/credentials/keys), and store it in the example's directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all bullet points are 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://guides.github.com/features/mastering-markdown/

Look for Ordered lists. The benefit of starting all items with 1. is that Markdown will increment the number for you, so when you add/modify/delete items, you don't have to renumber.

Follow the steps below to connect the FreeRTOS application to the MQTT bridge.

Before you begin, generate a [public/private key pair](https://cloud.google.com/iot/docs/how-tos/credentials/keys), store the private key in the `examples/freertos_linux/Linux_gcc_gcp_iot` directory, and name the key `ec_private.pem`.
1. Go to the repository's root directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an instruction. Reading it I thought I have to figure out something, although this just describes the effects of the command below. I'd just keep the style: run this please, btw: this is the result. @soyrice PTAL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/./: would work?

```
cd examples/freertos_linux/Linux_gcc_gcp_iot \
make
make clean_all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean_all, too drastic, although it is necessary. Since we don't know what was the previous mbedtls build: 32bit or 64bit. Still I'd give more automagical experience than forcing clean_all always.

Copy link
Contributor Author

@verkri verkri Mar 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, that it is too drastic, however this is the Makefile for the examples.

We can assume that people are building the examples when they check out the project and start evaluating. There, it's very bad if they hit build errors.

The degraded UX is when someone already has a build, then builds the example, then their code doesn't build any more, because the wrong mbedTLS library is there. However this path is less likely at this point of the project.

So I compare a +20sec buildtime against a +N mins/hours debugging.

Nevertheless, in another PR I can fix the mbedTLS library output, so the time window that this risk is there would be small.

WDYT?

Copy link
Contributor

@DellaBitta DellaBitta Mar 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this means that if I build the library with a specific CONFIG first, like all of our documentation tells the user to do, and THEN build the examples, that the special config is wiped out and replaced with a library built with the default config

I would rather solve this issue another way. Create new library target path for the 32bit and one for 64-bit libs of mbedTLS, and have the example depend on these directly, building them if necessary or at least alerting the user to their absence.

@atigyi atigyi requested a review from soyrice March 12, 2019 15:07
iotc_connect(context_handle, /*username=*/NULL, /*password=*/jwt,
/*client_id=*/iotc_device_path, connection_timeout,
/* 4. Connect to GCP IoT Core MQTT Bridge. */
iotc_connect(context_handle, /*username=*/"unused", /*password=*/jwt,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be pulled in, this bug caused our project a lot of grief figuring out that the NULL parameter for the username was tanking our connection routine @atigyi

@sheindel
Copy link
Contributor

sheindel commented Dec 4, 2019

@verkri I love some of the work you've done here, and I think it really improves the project. Would you be open to resolving the file conflicts so we can resurrect your efforts and get this merged in?

@galz10
Copy link
Contributor

galz10 commented Jun 18, 2020

Hi @verkri thank you for pointing out these issues, do you still want to merge this PR if so could you submit a no-op change so Travis CI could run its tests, if not i'll close out the PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants