Oops, sorry, forgot to give the URL for the Adafruit tutorial!
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout?view=all
Oops, sorry, forgot to give the URL for the Adafruit tutorial!
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout?view=all
@Danalux - If I may, I'd like to restate your situation and then make a (hopefully useful) small suggestion. Please correct me if the following is wrong:
If I'm understanding you, you have two totally separate problems and, having tried two separate programming environments, have found that each environment allows you to solve only one of the problems - but you want to solve both problems at the same time to get your project to work.
Problem (A): you have two ToF units which have been connected to a PaHUB and then the PaHUB is connected to an M5 Core. You need to be able to configure the PaHUB in order to talk to the two ToF units without them getting confused, but just using the normal I2C library is not working, there is some extra magic that is required.
Problem (B): you want to talk to the completed project from another device using UDP over your network connection (this "project controller" is possibly a desktop computer, possibly another microcontroller, it does not matter which, we just care that it wants to use UDP). You want to give the M5 Core a static IP address so that the project controller knows where to send the messages in order to know that it is talking to the correct device.
When you use UIFlow, you can solve (A) but not (B). When you use Arduino, you can solve (B) but not (A).
Normally, (B) is a very standard sort of thing to want to do (it is very very common to want to set a static IP address no matter what hardware or what programming environment your project is using), whilst (A) is rather tricksy (not that many people have to use a PaHUB or similar, if only because many I2C devices allow you to change the I2C address, which makes it easier to use two identical sensors on one gadget).
So you are - very reasonably - hoping that UIFlow ought to be able to solve (B), the more commonly encountered problem, hence your original question: does anyone know how to set a static IP address when writing a program using UIFlow.
Now, assuming that you agree that I've just described the situation accurately, I'm sorry to say that - I do not know how to set a static when using UIFlow! Sorry.
BUT as you say you are using Arduino as an alternative, you might like to read this article from Adafruit, which explains how the chip inside the PaHUB works and provides an example of how to use it from an Arduino sketch. Using this, you should be able to use the PaHUB and the two ToF units from your Arduino sketch. If you plug everything in and then run the "scanner" sketch you should see how to make your sketch work.
Failing that, as I don't know UIFlow, I'd suggest looking at how your local network is controlled. If you can't set a static IP then the M5 Core is presumably picking up an IP adrress from a DHCP server on the network, very probably one within your Router. Your DHCP server ought to be able to always give the M5 Core the same address, one that you select and therefore one that you can tell to the project controller. As long as the devices are always being used on your local network that will have a very similar effect to setting a static IP. Not 100% the same, but often Just Good Enough.