synchronizing multiple slaves in an I2C network using dsPIC33EP256GP502 - interrupt

dsPIC33EP syncronisation
Hello,
Can someone explain how can I synchronize multiple slaves in an I2C network using dsPIC33EP256GP502 and the details are attached in the link above.
Thanks and Regards,
Akhil

Related

Redis PUB/SUB and high availability

Currently I'm working on a distributed test execution and reporting system. I'm planning to use Redis PUB/SUB as a message queue and message distribution system.
I'm new to Redis, so I'm trying to read as many docs as I can and play around with it. One of the most important topics is high availability. As I said, I'm not an expert, but I'm aware of the possible options - using Sentinel, replication, clustering, etc.
What's not clear for me is how the Pub/Sub feature and the HA options are related each other. What's the best practice to build a reliable messaging system with Redis? By reliable I mean if my Redis message broker is down there should be some kind of a backup node (a slave?) that should be able to take over this role.
Is there a purely server-side solution? Or do I need to create a smart wrapper around the Redis client to handle this? Will a Sentinel-driven setup help me?
Doing pub sub in Redis with failover means thinking about additional factors in the client side. A key piece to understand is that subscriptions are per-connection. If you are subscribed to a channel on a node and it fails, you will need to handle reconnect and resubscribe. Because subscriptions are done at the connection level it is not something which can be replicated.
Regarding the details as to how it works and what you can expect to see, along with ways around it see a post I made earlier this year at https://objectrocket.com/blog/how-to/reliable-pubsub-and-blocking-commands-during-redis-failovers
You can lower the risk surface by subscribing to slaves and publishing to the master, but you would then need to have non-promotable slaves to subscribe to and still need to handle losing a slave - there is just as much chance to lose a given slave as there is a master.
IMO, PUB/SUB is not a good choice, may be disque (comes from antirez, author of the Redis) fits better:
Disque, an in-memory, distributed job queue

Is it necessary to use three nodes to build RabbitMQ cluster?

I have to say the official website provides very little information to understand RabbitMQ clearly.
The official website suggests using three nodes to build a cluster. What is the reason for that? I suppose it's like ZooKeeper, which needs an odd number of nodes to do a quorum and elect the master.
Also, what is the advantage of using a non-HA cluster? Improve the performance or what? If the node which a queue resides is down, then the queue is not working. So for all situation, is it necessary to set the cluster to be mirror queue and auto-sync?
Three nodes is the minimum to have a reasonable HA.
Suppose you have a queue mirrored in two nodes, if one gets down, another one will be promoted as the new slave or master.
Please read here section Automatically handling partitions and the section More about pause-minority mode
is therefore not a good idea to enable pause-minority mode on a
cluster of two nodes since in the event of any network partition or
node failure, both nodes will pause
RabbitMQ can handle the cluster in different ways, depending on where you deploy it - LAN or WAN or unstable LAN etc. And you can also use federation, shovel
what is the advantage of using a non-HA cluster? Improve the performance or what?
I'd say yes, or simply you have an environment where you don't need to have HA queues since you can have only temporary queues.
is it necessary to set the cluster to be mirror queue and auto-sync?
You can also decide for manual-sync, since when you sync the queue is blocked, and if you have lots of messages to sync, it can be a problem. For example, you can decide to sync the queues when you don't have traffic.
Here (section Unsynchronised Slaves) it is explained clearly.
Your question is a bit general, and it depends on what are you looking for.

Is I2C master to Master communication possible?

Is it possible for an I2C master device to communicate with another I2C master device ?
Thanks
Yes! As long as it specifies that it can do Multi Master operation, then it can communicate with another Master device. There is a clock synchronization procedure that two masters need to perform. To see how that works, read this PDF, section 4.3.1
I2C FPGA Core from Opencores
Yes it's possible..
But clock synchronization is important part.
Hope u go through above given PDF.

Is simultaneous I2C, SPI and USB communication between multiple MSP430s possible?

I have programmed a couple of MSP430x6xx microcontrollers to serve as Master for some I2C slave devices. One of the MSP430s transfer the data received from I2C slaves to a PC using its built in USB Module. I want to extend this to allow all Micro controllers to send data received from their respective I2C slaves to PC using a common bus system. Will it be feasible to use SPI for transferring the data from all MSP430s to a single MSP430 master(already serving as I2C master and USB device simultaneously) which then transfers it to PC? I would appreciate any other suggestions. Thanks
Yes, it is feasible we will have to write your firmware to handle this. You have to identify on the PC somehow from whom SPI/I2C slave it comes the data. So, your main MSP430xxx will do this adding some kind of header to the data saying the id of the slave device.

Question about Process communication over USB cable

I have some questions regarding communication over USB cable in Linux, in a Host-Target Device environment.(USB2.0) Please help as we are stuck for the below imiplementation.
We have a host PC connected to a target device (Linux OS) through USB cable.
On the target device we need to spawn 3 or 4 child processes. [Using fork() or some equivalent system call]
All the child process should communicate to the host PC independently though there own source file descriptor and sink file descriptors.
As per our experimentation, one process communicates to the PC at a time then the control is given to another process. But our requirement is for simultaneous communication. We are not sure whether USB driver(2.0/3.0) supports this methodology.
Any pointers regarding this will be helpful.
Thank you.
-AD
As per our experimentation, one process communicates to the PC at a time then the control is given to another process.
This is how computers work. Only one thread at a time has control of a particular CPU - when it blocks for i/o or exhausts its quantum, control is given to another thread.
What do you need simultaneity for that you can't manage with sending data one after the other?
USB is a serial bus protocol with a SINGLE DATA BUS, and this means, what you are looking for is not possible.
But we can have 4 different USB COMMUNICATION PIPES which can provide different paths, but NOT simultaneously.