Skip to content

Update the firware binary to work with latest cc3200-rs #39

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

Merged
merged 4 commits into from
Nov 28, 2016

Conversation

fabricedesre
Copy link
Collaborator

Changes in this PR are:

  • Update to current cc3200-rs master
  • src/main.rs is now a simple runner, right now sending temperature readings.
  • the wlan setup moved to wlan.rs
  • config.rs.sample needs to be copied to config.rs with your actual parameters.

@fabricedesre
Copy link
Collaborator Author

ping @dhylands
Travis seems to have a hard time with cargo right now...

}

pub const SENSOR_READING_COUNT: u32 = 10;
pub const SERVER_URL: &'static str = "http://10.252.33.211:8000/endpoint";
Copy link
Member

Choose a reason for hiding this comment

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

nit: no newline at end of file

@@ -9,5 +9,6 @@ export PATH=/home/travis/.cargo/bin:$PATH
rustup default nightly
rustup component add rust-src
cargo install xargo
cp src/config.rs.sample src/config.rs
Copy link
Member

Choose a reason for hiding this comment

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

That seems like a reasonable way to do it in cc3200-rs as well (and addresses your concern about checking the file in accidentally).


for _ in 0..config::SENSOR_READING_COUNT {
let temperature: u32 = (temp_sensor.get_temperature().unwrap() * 10.0) as u32;
info!("Feels like {}.{} C", temperature / 10, temperature % 10);
Copy link
Member

Choose a reason for hiding this comment

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

nit: This will report interesting results with a negative temperature :)

info!("Received {}",
response.body.read_string_to_end(&mut buffer).unwrap());
CurrentTask::delay(Duration::ms(1000))
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't see where this actually sends a temperature to the server.

@fabricedesre
Copy link
Collaborator Author

@dhylands I addressed comments and pinned Rustc to the same version as in cc3200-rs. That fixed the unrelated cargo issue which is rust-lang/cargo#3340

@dhylands
Copy link
Member

lgtm

@fabricedesre fabricedesre merged commit 112c0d1 into mozilla-sensorweb:master Nov 28, 2016
@fabricedesre fabricedesre deleted the issue-36 branch November 28, 2016 23:34
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.

2 participants