Controlling Mobius enabled VorTech pump using 0-10V (and BLE)

brendann993

New Member
View Badges
Joined
May 2, 2021
Messages
3
Reaction score
1
Location
Perth Australia
Rating - 0%
0   0   0
I don't know if its a lack of knowledge or something else going (my c++ knowledge fairly limited) but I've been unable to get the library working. Originally I was just testing the CRC part seperately in a c++ compiler which appears to not like the CRC16_TABLE as it spits out alot of errors "narrowing conversion of ‘-32504’ from ‘int’ to ‘uint16_t {aka short unsigned int}’ inside { } [-Wnarrowing]" SoI tried moving to the Arduino compiler thinking that maybe thats the issue but get the same errors there .
My hope is to somehow add the functionality to ESPHOME which is a esp library but I feel Im so far off understanding the basics thats unlikely to occur
 

LVReef

Community Member
View Badges
Joined
Feb 13, 2021
Messages
64
Reaction score
57
Location
Livermore, CA
Rating - 0%
0   0   0
I took at this library and there are several issues so far:
  • The narrowing warning you get. Although this can be solved with -Wno-narrowing
  • The library incorrectly assumes that 01ff0100-ba5e-f4ee-5ca1-eb1e5e4b1ce0 is specific to Mobius when it's a wireless UART service. I get 8 devices when I do a scan.
  • Uses an old deprecated version of the BLE library. For example, the tries to make a call to bool BLERemoteCharacteristic::writeValue when in fact the signature is void.
I played with it for 30 minutes, excluding MAC addresses that didn't work but ultimately I wasn't able to get the coveted "Scene 0" output. The best I got was scene 65535, which is likely an error.

Not sure if @mard is still around or if I should try to fork and fix the library.
 
OP
OP
mard

mard

Community Member
View Badges
Joined
Jul 8, 2020
Messages
35
Reaction score
76
Location
Minnesota
Rating - 0%
0   0   0
Yep, I am still around. :)

I haven't touched the library since I created it (in June 2021) because it has been working wonderfully for me. Since it has been about 2 years it does not surprise me there newer versions of the dependencies.
If you would like me to make some updates, I certainly could but it will be several weeks before I will have time to sit down and work on it in earnest (in addition to setting up my dev environment again).
Constructive feedback and recommendations are always welcome. And if you would like to create a PR I would be happy to merge it (after testing it of course ;))!
 

LVReef

Community Member
View Badges
Joined
Feb 13, 2021
Messages
64
Reaction score
57
Location
Livermore, CA
Rating - 0%
0   0   0
Awesome! I’ll likely do a PR then; much simpler. Hopefully I get some time this weekend to try a few things. My main goal is to trigger feed mode for my 3 MP40s. I also have 4 xr30 so I might see some interesting traffic as well.
 

LVReef

Community Member
View Badges
Joined
Feb 13, 2021
Messages
64
Reaction score
57
Location
Livermore, CA
Rating - 0%
0   0   0
Good and bad news. I made some progress but the ESP32 crashes when receiving the response. I was going to continue troubleshooting this weekend but Neptune just released their MXM module which solves my 1 push feed problem. So as much as I want to geek out on figuring that one out, I went the easy way and bought an MXM module.
 

BeanAnimal

2500 Club Member
View Badges
Joined
Jul 16, 2009
Messages
2,807
Reaction score
4,368
Rating - 0%
0   0   0
I took at this library and there are several issues so far:
  • The narrowing warning you get. Although this can be solved with -Wno-narrowing
  • The library incorrectly assumes that 01ff0100-ba5e-f4ee-5ca1-eb1e5e4b1ce0 is specific to Mobius when it's a wireless UART service. I get 8 devices when I do a scan.
  • Uses an old deprecated version of the BLE library. For example, the tries to make a call to bool BLERemoteCharacteristic::writeValue when in fact the signature is void.
I played with it for 30 minutes, excluding MAC addresses that didn't work but ultimately I wasn't able to get the coveted "Scene 0" output. The best I got was scene 65535, which is likely an error.

Not sure if @mard is still around or if I should try to fork and fix the library.
New to Arduino - where can I set -Wno-narrowing flag? Please don't tell me I have to edit the root config for arduino?

Would much prefer to fix this - but have not looked at the code to see where the cast needs to be done. Narrowing really should not be ignored - and I think always should have been an error, but GCC used to fire them as warnings, not errors. Looks like Arduino is now using up-to-date GCC??

Can you share any other code updates that you made? The Mobius app is pretty bad IMHO and I would like to get the Profilux controlling my MP10s.
 

BeanAnimal

2500 Club Member
View Badges
Joined
Jul 16, 2009
Messages
2,807
Reaction score
4,368
Rating - 0%
0   0   0
I took at this library and there are several issues so far:
  • The narrowing warning you get. Although this can be solved with -Wno-narrowing
  • The library incorrectly assumes that 01ff0100-ba5e-f4ee-5ca1-eb1e5e4b1ce0 is specific to Mobius when it's a wireless UART service. I get 8 devices when I do a scan.
  • Uses an old deprecated version of the BLE library. For example, the tries to make a call to bool BLERemoteCharacteristic::writeValue when in fact the signature is void.
I played with it for 30 minutes, excluding MAC addresses that didn't work but ultimately I wasn't able to get the coveted "Scene 0" output. The best I got was scene 65535, which is likely an error.

Not sure if @mard is still around or if I should try to fork and fix the library.
I think the function can be rewritten to remove the narrowing error - but my C is rusty.

uint16_t MobiusCRC::crc16(uint8_t* data, int length) {
uint16_t crc16 = 0xFFFF; // Initialize with 0xFFFF
for (int i = 0; i < length; i++) {
uint8_t dex = (data ^ (crc16 >> 8)) & 0xFF;
crc16 = (crc16 << 8) ^ Mobius::CRC16_TABLE[dex];
}
return crc16;
}

OR using cast


uint16_t MobiusCRC::crc16(uint8_t* data, int length) {
uint16_t crc16 = static_cast<uint16_t>(-1);
for (int i = 0; i < length; i++) {
uint8_t dex = (data ^ static_cast<uint8_t>(crc16 >> 8)) & 0xff;
crc16 = static_cast<uint16_t>((crc16 << 8) ^ Mobius::CRC16_TABLE[dex]);
}
return crc16;
}
 
Last edited:

fendanto

Community Member
View Badges
Joined
May 6, 2023
Messages
53
Reaction score
48
Location
Boston
Rating - 0%
0   0   0
I wrote up a PR for the ESP32-MobiusBLE library to switch over from ESP32_BLE_Arduino to NimBLE-Arduino. Hopefully this resolves some issues for anybody trying to use it. Others can pull down my fork if they want to try it. Thanks for the hard work on that library!

 

Mastering the art of locking and unlocking water pathways: What type of valves do you have on your aquarium plumbing?

  • Ball valves.

    Votes: 33 52.4%
  • Gate valves.

    Votes: 35 55.6%
  • Check valves.

    Votes: 13 20.6%
  • None.

    Votes: 14 22.2%
  • Other.

    Votes: 5 7.9%
Back
Top