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

Cant connect to MQTT server if experiment is loaded via QR Code #57

Open
aamiel1 opened this issue Jul 11, 2023 · 1 comment
Open

Cant connect to MQTT server if experiment is loaded via QR Code #57

aamiel1 opened this issue Jul 11, 2023 · 1 comment

Comments

@aamiel1
Copy link

aamiel1 commented Jul 11, 2023

Hi,

I create this MXL and load it to the Editor, In the Editor i go to the XLM tab to preview the XML, but I see it without the "" section. I also try to use this experiment in the app, but no MQTT message was sent.

<phyphox version="1.11" locale="en">
  <title>MQTT/JSON</title> 
  <category>Net examples</category>
  <icon>://</icon>
  <description>Test for mqtt/json.</description>
  <data-containers>
    <container size="1">accX</container>
    <container size="1">accY</container>
    <container size="1">accZ</container>
  </data-containers>
  <network>
    <connection address="1.1.1.1:1234" autoConnect="true" service="mqtts/json" password="mqttpass" username="mqttusername" sendTopic="phyphox/acc" id="test" privacy="https://phyphox.org/disclaimer/" conversion="json">
        <send id="x" type="buffer" datatype="number">accX</send>
        <send id="y" type="buffer" datatype="number">accY</send>
        <send id="z" type="buffer" datatype="number">accZ</send>
    </connection>
  </network>
  <input>
    <sensor type="accelerometer" rate="10">
      <output component="x">accX</output>
      <output component="y">accY</output>
      <output component="z">accZ</output>
    </sensor>
  </input>
  <views>
    <view label="Test">
      <value label="Accelerometer x" size="2" precision="2" unit="m/s²">
        <input>accX</input>
      </value>
      <value label="Accelerometer y" size="2" precision="2" unit="m/s²">
        <input>accY</input>
      </value>
      <value label="Accelerometer z" size="2" precision="2" unit="m/s²">
        <input>accZ</input>
      </value>
      <button label="Submit">
        <trigger>test</trigger>
      </button>
    </view>
  </views>
</phyphox>
@Staacks
Copy link
Member

Staacks commented Jul 13, 2023

The first part of your question is not surprising: MQTT or network connections in general are part of the bold warning when opening the editor. The current webeditor dies not support it and just ignores it when loading the configuration. So, unfortunately you will have to edit the XML with a text editor or wait for our new editor which should be published in its first test version in a few weeks.

The question why the XML is not working when loaded directly into phyphox might be trickier, because I don't have a test setup ready taht uses MQTTS with authentication - only basic MQTT. I assume address and credentials were replaced with your values before testing? MQTTS was actually not even implemented by ourselves and it is a rather niche usecase for phyphox. Since it also has never been implemented for the iOS version it is not even yet officially been documented, so at least for testing you might want to try plain MQTT first.

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

No branches or pull requests

2 participants