Skip to content
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

Fix pubber for proxy device through gateway, and also periodic discovery timing #341

Merged
merged 18 commits into from
May 26, 2022

Conversation

grafnu
Copy link
Collaborator

@grafnu grafnu commented May 25, 2022

No description provided.

@noursaidi
Copy link
Collaborator

I can't connect as GAT-123:

nournew@macbook-2 udmi % bin/pubber ~/udmi_site_model daq1-273309 GAT-123 123
Building pubber...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Running tools version 1.3.13-76-gd4622319
INFO daq.pubber.Pubber - 2022-05-26T11:14:40Z Configuring with key type ES256
Exception in thread "main" java.lang.NullPointerException
	at daq.pubber.Pubber.processDeviceMetadata(Pubber.java:291)
	at daq.pubber.Pubber.loadDeviceMetadata(Pubber.java:267)
	at daq.pubber.Pubber.initializeDevice(Pubber.java:353)
	at daq.pubber.Pubber.initialize(Pubber.java:525)
	at daq.pubber.Pubber.singularPubber(Pubber.java:215)
	at daq.pubber.Pubber.main(Pubber.java:200)

As AHU-22, it connects for a period but then disconnects with errors in terminal.
Looking at my GCP logs it looks like AHU-22 is being disconnected by GCP for updating state > 1/s and is not reattached after

@grafnu
Copy link
Collaborator Author

grafnu commented May 26, 2022 via email

bin/setup_base Outdated
@@ -1,5 +1,7 @@
#!/bin/bash

sudo apt-get install hxtools
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could generate a user prompt. If we going with rot13 how about:

sudo apt-get install -y hxtools

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -11,7 +11,11 @@ fi
project_id=$1
shift

echo 'Using target project (base64):' $(echo =$project_id | base64)
if [[ -n `which rot13` ]]; then
echo 'Using target project (rot13):' $(echo $project_id | rot13)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the goal here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added comment. Goal is to obfuscate so that it can be viewed in server-side logs.

@@ -65,6 +68,9 @@ public class MqttPublisher {
private static final int PUBLISH_THREAD_COUNT = 10;
private static final String HANDLER_KEY_FORMAT = "%s/%s";
private static final int TOKEN_EXPIRY_MINUTES = 60;
private static final int QOS_AT_MOST_ONCE = 0;
private static final int QOS_AT_LEAST_ONCE = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(NOP) It's interesting the library doesn't make constants for this stuff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I know -- I had to actually go look at documentation somewhere to figure out what the values were.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(NOP) Yeah, me too, to confirm/understand your naming. 2X work!

@grafnu grafnu merged commit 7a9dbcf into faucetsdn:master May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants