Serial stops sending to raspberry pi when ArduinoCloud.update(); is in the loop()

Hi,

welcome to the forum.

What is a bit uncommon is to define your functions inside function loop.

Defining a function inside another function means this function is only know within this function but not outside (this is called the "scope")

As you use those function only inside loop it does work.
Anyway It is not really clear to me what the situation is.
It would help if you write in more detail what you are trying to do.

I want to descrfibe in my own words what I guess what your description means

You have a Raspi that is controlling a cow-feeder
Your raspi is connected to a Arduino MKR GSM1400

The Raspi is sending messages like "open" , "closed" , "siren" to the Arduino MKR GSM1400

In which way = what are the hardware-connectors how the Arduino MKR GSM1400 is connected to the Raspi?

You coded the standard serial interface which belongs to the USB-connector

not very clear to me what this means
Who is "one" ? and where is the int variable set to what value in your code?

I can't see any int variable beeing set to a value in the code you have posted

I can't see any code that would do a "request from pi"
and it is unclear to me what "request from pi" means.

Which device is doing what?

Do you use some kind of IO-cloud-webinterface to make a request at the Arduino MKR GSM1400?

Your Arduino MKR GSM1400 sends a request to the raspi?

The Raspi is sending a request to the Arduino MKR GSM1400?

How does the request-"message" look like?"

All the posted code does is
if the Arduino MKR GSM1400 receives a "open" print "open" to the serial monitor

So you have to describe in much more details what you want to do

And the functionality you want to have

best regards Stefan