Problem with sending downlink via MQTT

EDIT: FIXED. Absolutely unbelievable! The ENTIRE problem was caused by copying the example JSON text from the web page, which has double-quotes that LOOK like “real” double-quotes (ASCII 0x22), but are in fact 0x9c. You would think that using pre-formatted text in MarkUp means “Use the text I typed”, not “Replace some characters with something that looks the same but is not”.

Running into this same problem here. Chirpstack is running in a container on port 11883. I subscribe to the MQTT server, and the device sends a message, and we see the message.

$ mosquitto_sub -h localhost -p 11883 -t 'application/+/device/+/rx'
application/1/device/e00227005046162e/rx {"applicationID":"1","applicationName":"thing-handler","deviceName":"thing-1","devEUI":"e00227005046162e","rxInfo":[{"gatewayID":"00800000a0005872","uplinkID":"333a511e-2237-4f20-aaeb-191e330cf90d","name":"Multitech-MTCDT-L4N1-247A","time":"2020-02-23T19:11:04.436671Z","rssi":-50,"loRaSNR":9.2,"location":{"latitude":34.19129,"longitude":-83.94138,"altitude":374}}],"txInfo":{"frequency":903300000,"dr":3},"adr":true,"fCnt":3,"fPort":9,"data":"oAAc"}

So following the above, to send data to the device, I should do:

mosquitto_pub \
-d \
-h localhost \
-p 11883 \
-t “application/1/device/e00227005046162e/tx” \
-m '{ “confirmed”: true, “fPort”: 3, “data”: “AAAACg==” }'

And we see this:

Client mosq-HgJc53NKVySjJucfic sending CONNECT
Client mosq-HgJc53NKVySjJucfic received CONNACK (0)
Client mosq-HgJc53NKVySjJucfic sending PUBLISH (d0, q0, r0, m1, '“application/1/device/e00227005046162e/tx”', ... (69 bytes))
Client mosq-HgJc53NKVySjJucfic sending DISCONNECT

But I never see the data get queued or sent. If I send the same string to the same port via the web UI, it works fine. So what am I doing wrong when I use mosquitto_pub? I have tried putting the JSON string in a file and using the -f option, but that made no difference.

If I subscribe to the topic with mosquitto_sub -p 11883 -t '#' -v, I see

application/1/device/e00227005046162e/tx {“confirmed”:true,“fPort”:3,“data”:“AAAACg==”}

returned by mosquito_sub

Also, where does the 1 in the application/1/device/e00227005046162e/tx string come from? I presume it’s the applicationID we see in the received string, based on a sample of one.