ggerganov / ggwave

Tiny data-over-sound library
https://youtu.be/Zcgf77T71QM
MIT License
1.94k stars 156 forks source link

ggwave.js doesn't have much options like waver.js #77

Closed jitendra1607 closed 2 years ago

jitendra1607 commented 2 years ago

I am trying to receive a message on the web page (https://github.com/ggerganov/ggwave/blob/master/examples/arduino-rx-web/index-tmpl.html) without any success.

it works great with the waver android app using the following settings in screenshots.

photo1662395027 (1) photo1662395027

But I could not find the same settings in ggwave.js. Please pay attention to the following console warning "[Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)"

ggerganov commented 2 years ago

I think the web page does not receive data from the microcontroller because of the frequency shift that we did. Can you confirm that when you remove the shift (i.e. comment the line I told you in the previous issue) and use a normal speaker (not buzzer) you are able to receive data in the web page?

jitendra1607 commented 2 years ago

I don't think so because 'https://waver.ggerganov.com/' is capturing data with the above settings as shown in screenshots. However 'https://ggwave-js.ggerganov.com/' is unable to capture data, and I couldn't find 'MT_FASTEST' in ggwave object from ggwave.js library.

jitendra1607 commented 2 years ago

i tried to play 'https://user-images.githubusercontent.com/1991296/168469004-aeb9b9fe-cf81-4db7-b602-62e4ae659341.mp4' in a smartphone while the webpage 'https://ggwave-js.ggerganov.com/' opened in the laptop for capturing data. The webpage not capturing properly and show garbage data sometimes.

ggerganov commented 2 years ago

Hi, I just pushed a change to master that adds the MT protocols to the emscripten port of ggwave.

Additionally, there are now functions for setting the freqStart parameter of the protocols through JS:

https://github.com/ggerganov/ggwave/blob/d02960259bbf44c30eaf941a35e9aaf4510013c2/bindings/javascript/emscripten.cpp#L120-L130

See an example here:

https://github.com/ggerganov/ggwave/blob/d02960259bbf44c30eaf941a35e9aaf4510013c2/examples/arduino-rx-web/index-tmpl.html#L98-L101

In the video that you posted, I was still trying out different settings so the protocol that I used is no longer supported. Instead, you should use the MT protocols that are currently available in ggwave.

You cannot use https://ggwave-js.ggerganov.com/ to receive Fixed-length messages, because it is configured to listen for variable-length messages. See explanation here:

https://github.com/ggerganov/ggwave/blob/d02960259bbf44c30eaf941a35e9aaf4510013c2/include/ggwave/ggwave.h#L105-L115


You can use the https://arduino-rx.ggerganov.com/ example to receive MT messages with Fixed-length = 16 and DSS enabled.

My advice is to first try using the Waver app with MT protocol to send messages to https://arduino-rx.ggerganov.com/ Make sure that the Freq shift in your Waver app is disabled. Let me know if this works.

jitendra1607 commented 2 years ago

@ggerganov I tried this and it is working very well. Thank you.