azure / azure-sphere-gallery Goto Github PK
View Code? Open in Web Editor NEWA collection of inspirational, unmaintained Azure Sphere software and hardware designs ready to be reused.
A collection of inspirational, unmaintained Azure Sphere software and hardware designs ready to be reused.
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
This repository is currently missing a LICENSE.MD file outlining its license. A license helps users understand how to use your project in a compliant manner. You can find the standard MIT license text at the Microsoft repo templates LICENSE file: https://github.com/microsoft/repo-templates/blob/main/shared/LICENSE.
If you would like to learn more about open source licenses, please visit the document at https://aka.ms/license.
While studying the IndutrialDeviceController example I have gone through all files, but can't find the actual format/device setting to work with the specific modbus registers. Want to use this with a very well known XY-MOD2 SHT20 sensor.
Regards,
Erik
Can these `unsafe` markers be reduced just to the link where they are used?
Originally posted by @rylev in #101 (comment)
This big chain might be clearer if you first `and` the options together:
package_config.target_hardware,.as_ref().and(app_package).and(hardware);
Originally posted by @rylev in #101 (comment)
You're calling `name.to_string` every time which is an unnecessary allocation. It's preferable to call `unwrap_or_else`. Granted this isn't a very hot code path so in practice, it won't make a difference.
Originally posted by @rylev in #101 (comment)
It would be really awesome if this library always had comments on every `unsafe` usage describing why the `unsafe` usage is sound. Something like:
// UNSAFE: $REASON
Originally posted by @rylev in #101 (comment)
We should enable clippy in CI.
In MUSL, __syscall_cp_c() polls for __pthread_self()->cancel not equal to zero, and if true, calls __cancel() to stop the thread. This code is all correct, but when Rust apps make a syscall, either the __pthread_self() pointer is bad, or the value of ->cancel is bad (0x10000 typeically), and the attempt to cancel the sole thread crashes with SIGSEGV.
This is only a problem for Rust apps built with Rust 1.71.0 or newer, Older builds of rustc don't repro the issue. I'll investigate.
Here is a typical callstack from a SIGSEGV during a syscall for open() in a single-threaded app that isn't using pthreads for anything:
(gdb) info stack
#0 0x00000000 in ?? ()
#1 0xbeec564e in pthread_exit () from target:/lib/ld-musl-armhf.so.1
#2 0xbeed70fa in ?? () from target:/lib/ld-musl-armhf.so.1
#3 0xbeed7156 in ?? () from target:/lib/ld-musl-armhf.so.1
#4 0xbeeaa3ca in open64 () from target:/lib/ld-musl-armhf.so.1
#5 0xbeeaa248 in __z_azsp_open () from target:/lib/ld-musl-armhf.so.1
#6 0x0002f916 in ADC_Open (id=0) at /opt/azurespheresdk/Sysroots/16/usr/include/applibs/adc_internal.h:24
#7 0x0003044c in ADC_Open_inline (id=0) at ../azure-sphere-sys/static_inline_helpers.c:30
#8 0x0001c4d8 in azure_sphere::applibs::adc::AdcController::new (controller_id=0)
at azure-sphere/src/applibs/adc.rs:63
#9 0x00016ca0 in allapis::main () at samples/allapis/src/main.rs:62
Hi. I have tried the MQTT sample in the azure sphere gallery. It worked fine. Now I have been trying to connect 2 device. I got continuous error whenever I added more client on the python code.
These are the changes done.
broker_address='test.mosquitto.org'
def on_message1(client1, userdata, message1):
msg1=str(message1.payload.decode("utf-8"))
print("received message =",msg1)
msg1=msg1[len(msg1)-1]+msg1[0:len(msg1)-1]
client1.publish("azuresphere/sample/device1",msg1)
def on_connect1(client1, userdata, flags, rc):
print("Connected ")
client1.subscribe("azuresphere/sample/host")
client1=paho.Client()
client1.on_message=on_message1
client1.on_connect=on_connect1
def on_message2(client2, userdata, message2):
msg2=str(message2.payload.decode("utf-8"))
print("received message =",msg2)
msg2=msg2[len(msg2)-1]+msg2[0:len(msg2)-1]
client2.publish("azuresphere/sample/device2",msg2)
def on_connect2(client2, userdata, flags, rc):
print("Connected ")
client2.subscribe("azuresphere/sample/host")
client2=paho.Client()
client2.on_message=on_message2
client2.on_connect=on_connect2
print("connecting to broker")
parentDir=os.path.abspath(os.path.join(Path(os.path.dirname(os.path.realpath(file))), os.pardir))
certsDir=os.path.join(parentDir,'HighLevelApp','Certs')
print(certsDir)
if (os.path.exists(os.path.join(certsDir,'mosquitto.org.crt'))):
print('mosquitto cert exists')
else:
print("mosquitto cert doesn't exist :(")
client1.tls_set(ca_certs=os.path.join(certsDir,'mosquitto.org.crt'), certfile=os.path.join(certsDir,'client.crt'), keyfile=os.path.join(certsDir,'client.key'), cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLSv1_2)
client1.tls_insecure_set(False)
client1.connect(broker_address, 8883, 60)
client2.tls_set(ca_certs=os.path.join(certsDir,'mosquitto.org.crt'), certfile=os.path.join(certsDir,'client.crt'), keyfile=os.path.join(certsDir,'client.key'), cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLSv1_2)
client2.tls_insecure_set(False)
client2.connect(broker_address, 8883, 60)
##start loop to process received messages
client1.loop_forever()
client2.loop_forever()
Thank You.
It looks like the `toml` crate has support for serde deserialization. Would that be easier to use than manually parsing?
Originally posted by @rylev in #101 (comment)
First off, thank you for publishing this tool! I'm trying to use the tool to help me locate a memory leak and I have one documentation suggesting and a question.
The instructions should include a step to add the heap_tracker.c file in the CMakeLists.txt file. For the AzureIoT example the user would add the following two lines to the common/CMakeLists.txt file.
${CMAKE_CURRENT_LIST_DIR}/heap_tracker_lib.c
${CMAKE_CURRENT_LIST_DIR}/heap_tracker_lib.h
I'm trying to use the library in an application that connects to my IoTHub and I see warnings printed out . .
Heap-Tracker lib: WARNING! Native free(0xbef04e10) was called instead of _free() helper: 'heap_allocated' will not be reliable from now on!
I see these messages after sending an device twin update or telemetry to my IoTHub.
I've located all the calls to free() in my application code, but I suspect that the Azure Sphere SDK libraries are calling free() and it's not obvious to me how to extend the heap tracker functionality to the Azure Sphere libraries.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.