Git Product home page Git Product logo

azure-sphere-gallery's Issues

Definition of device modbus registers

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

Rust apps hit SIGSEGV randomly during syscalls, regression in Rust 1.71.0 and newer

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

Azure Sphere MQTT multiple device issue

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.

Instruction update for the Heap tracker and question

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!

Date not set

Thanks for the code.
image

This was my output . How can I fix the date?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.